From f462beaaa968d13fcb7d4ff3e28f66a64698e285 Mon Sep 17 00:00:00 2001 From: austinv11 Date: Tue, 28 Jul 2015 22:16:44 -0400 Subject: [PATCH] Fixes #98 *Facedesk* --- .../peripheralsplusplus/tiles/TileEntityChatBox.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/austinv11/peripheralsplusplus/tiles/TileEntityChatBox.java b/src/main/java/com/austinv11/peripheralsplusplus/tiles/TileEntityChatBox.java index 5852c27d..a8946b2d 100644 --- a/src/main/java/com/austinv11/peripheralsplusplus/tiles/TileEntityChatBox.java +++ b/src/main/java/com/austinv11/peripheralsplusplus/tiles/TileEntityChatBox.java @@ -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); + } } } }