Skip to content

Commit

Permalink
Fixes #98
Browse files Browse the repository at this point in the history
*Facedesk*
  • Loading branch information
austinv11 committed Jul 29, 2015
1 parent a9bf1ad commit f462bea
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,17 @@ public static class ChatListener {
public void onChat(ServerChatEvent event) {
if (Config.enableChatBox) {
String commandPrefix = Config.chatboxCommandPrefix.trim();
if (!commandPrefix.equals("") && !commandPrefix.equals(" ")) {
if (!commandPrefix.equals("") && !commandPrefix.equals(" ") && event.message.startsWith(commandPrefix)) {
event.setCanceled(true);
for (TileEntityChatBox box : chatBoxMap.keySet()) {
if (Config.readRange < 0 || Vec3.createVectorHelper(box.xCoord, box.yCoord, box.zCoord).distanceTo(event.player.getPosition(1.0f)) <= Config.readRange)
box.onCommand(event.player, event.message);
}
}
for (TileEntityChatBox box : chatBoxMap.keySet()) {
if (Config.readRange < 0 || Vec3.createVectorHelper(box.xCoord,box.yCoord,box.zCoord).distanceTo(event.player.getPosition(1.0f)) <= Config.readRange)
box.onChat(event.player, event.message);
} else {
for (TileEntityChatBox box : chatBoxMap.keySet()) {
if (Config.readRange < 0 || Vec3.createVectorHelper(box.xCoord, box.yCoord, box.zCoord).distanceTo(event.player.getPosition(1.0f)) <= Config.readRange)
box.onChat(event.player, event.message);
}
}
}
}
Expand Down

0 comments on commit f462bea

Please sign in to comment.