diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java index a148b1d2d..a6661c541 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/BukkitPlayer.java @@ -67,8 +67,9 @@ public class BukkitPlayer extends PlotPlayer { @Override public void sendMessage(String message) { - if (!StringMan.isEqual(this.getMeta("lastMessage"), message)) { + if (!StringMan.isEqual(this.getMeta("lastMessage"), message) || (System.currentTimeMillis() - this.getMeta("lastMessageTime") > 5000)) { setMeta("lastMessage", message); + setMeta("lastMessageTime", System.currentTimeMillis()); this.player.sendMessage(message); } } diff --git a/Sponge/src/main/java/com/plotsquared/sponge/object/SpongePlayer.java b/Sponge/src/main/java/com/plotsquared/sponge/object/SpongePlayer.java index 33560973e..9a306993f 100644 --- a/Sponge/src/main/java/com/plotsquared/sponge/object/SpongePlayer.java +++ b/Sponge/src/main/java/com/plotsquared/sponge/object/SpongePlayer.java @@ -74,8 +74,9 @@ public class SpongePlayer extends PlotPlayer { @Override public void sendMessage(String message) { - if (!StringMan.isEqual(this.getMeta("lastMessage"), message)) { + if (!StringMan.isEqual(this.getMeta("lastMessage"), message) || (System.currentTimeMillis() - this.getMeta("lastMessageTime") > 5000)) { setMeta("lastMessage", message); + setMeta("lastMessageTime", System.currentTimeMillis()); this.player.sendMessage(ChatTypes.CHAT, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(message)); } }