diff --git a/pom.xml b/pom.xml index ccf04d47b..62a4ffc9f 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ UTF-8 PlotSquared - 3.1.8 + 3.1.9 PlotSquared jar diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Comment.java b/src/main/java/com/intellectualcrafters/plot/commands/Comment.java index aa87d24bb..7876bdeb1 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Comment.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Comment.java @@ -32,6 +32,7 @@ import com.intellectualcrafters.plot.object.comment.PlotComment; import com.intellectualcrafters.plot.util.CommentManager; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.StringMan; +import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.general.commands.CommandDeclaration; @CommandDeclaration( @@ -83,6 +84,11 @@ public class Comment extends SubCommand { sendMessage(player, C.COMMENT_SYNTAX, StringMan.join(CommentManager.inboxes.keySet(),"|")); return false; } + for (PlotPlayer pp : UUIDHandler.getPlayers().values()) { + if (pp.getAttribute("chatspy")) { + MainUtil.sendMessage(pp, "/plot comment " + StringMan.join(args, " ")); + } + } sendMessage(player, C.COMMENT_ADDED); return true; } diff --git a/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java b/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java index c6e9d2360..69e4b1a1c 100644 --- a/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java +++ b/src/main/java/com/intellectualcrafters/plot/commands/Toggle.java @@ -83,10 +83,10 @@ public class Toggle extends SubCommand { @Override public boolean onCommand(PlotPlayer player, String[] args) { if (toggle(player, "chatspy")) { - MainUtil.sendMessage(player, C.TOGGLE_ENABLED, getCommand()); + MainUtil.sendMessage(player, C.TOGGLE_DISABLED, getCommand()); } else { - MainUtil.sendMessage(player, C.TOGGLE_DISABLED, getCommand()); + MainUtil.sendMessage(player, C.TOGGLE_ENABLED, getCommand()); } return true; } diff --git a/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/src/main/java/com/intellectualcrafters/plot/object/Plot.java index aa789b355..b5a5b126f 100644 --- a/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -46,6 +46,7 @@ import com.intellectualcrafters.plot.util.ChunkManager; import com.intellectualcrafters.plot.util.ClusterManager; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.SchematicHandler; +import com.intellectualcrafters.plot.util.StringMan; import com.intellectualcrafters.plot.util.TaskManager; /** @@ -948,7 +949,7 @@ public class Plot { if (this.hashCode() != other.hashCode()) { return false; } - return ((this.id.x.equals(other.id.x)) && (this.id.y.equals(other.id.y)) && (this.world.equals(other.world))); + return ((this.id.x.equals(other.id.x)) && (this.id.y.equals(other.id.y)) && (StringMan.isEqual(this.world, other.world))); } diff --git a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index b16cbd793..0f760eba8 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -601,7 +601,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen } } - @EventHandler(priority = EventPriority.HIGHEST) + @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled=true) public void onChat(final AsyncPlayerChatEvent event) { final Player player = event.getPlayer(); final String world = player.getWorld().getName(); @@ -626,7 +626,12 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen recipients.clear(); for (final Player p : Bukkit.getOnlinePlayers()) { PlotPlayer pp = BukkitUtil.getPlayer(p); - if (pp.getAttribute("chatspy") || plot.equals(pp.getCurrentPlot())) { + if (pp.getAttribute("chatspy")) { + String spy = event.getFormat(); + spy = String.format(spy, sender, message); + pp.sendMessage(spy); + } + else if (plot.equals(pp.getCurrentPlot())) { recipients.add(p); } } diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 664174a80..205b6f641 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index 1840d521c..2da400706 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ