diff --git a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatCommandSender.java b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatCommandSender.java index 8bd03ec..e80dfaa 100644 --- a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatCommandSender.java +++ b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatCommandSender.java @@ -28,4 +28,15 @@ public boolean isConsole() { public void sendMessage(ChatComponent component, ChatMessageType type, UUID uuid) { this.parser.sendMessage(this.sender, component, type, uuid); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + BukkitChatCommandSender other = (BukkitChatCommandSender) obj; + return this.parser.equals(other.parser) && this.sender.equals(other.sender); + } else { + return false; + } + } } \ No newline at end of file diff --git a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatOfflinePlayer.java b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatOfflinePlayer.java index 2c2b443..b0d552f 100644 --- a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatOfflinePlayer.java +++ b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatOfflinePlayer.java @@ -44,4 +44,15 @@ public boolean isOnline() { public ChatTeam getTeam() { return this.parser.toChatTeam(Bukkit.getScoreboardManager().getMainScoreboard().getEntryTeam(this.getName())); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + BukkitChatOfflinePlayer other = (BukkitChatOfflinePlayer) obj; + return this.parser.equals(other.parser) && this.player.equals(other.player); + } else { + return false; + } + } } \ No newline at end of file diff --git a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatServer.java b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatServer.java index 4ce25d2..fcae1cd 100644 --- a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatServer.java +++ b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatServer.java @@ -21,4 +21,15 @@ public Server getImpl() { public void execute(IChatPlugin plugin, Runnable runnable) { this.parser.execute(this.server.getScheduler(), plugin, runnable); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + BukkitChatServer other = (BukkitChatServer) obj; + return this.parser.equals(other.parser) && this.server.equals(other.server); + } else { + return false; + } + } } \ No newline at end of file diff --git a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatTeam.java b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatTeam.java index 6e6cbd6..1af4528 100644 --- a/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatTeam.java +++ b/craftbukkit/src/main/java/vakiliner/chatcomponentapi/craftbukkit/BukkitChatTeam.java @@ -39,4 +39,15 @@ public ChatComponent getPrefix() { public ChatComponent getSuffix() { return new ChatTextComponent(this.team.getSuffix()); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + BukkitChatTeam other = (BukkitChatTeam) obj; + return this.parser.equals(other.parser) && this.team.equals(other.team); + } else { + return false; + } + } } \ No newline at end of file diff --git a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatCommandSender.java b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatCommandSender.java index 72aa86e..a6848d9 100644 --- a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatCommandSender.java +++ b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatCommandSender.java @@ -28,4 +28,15 @@ public String getName() { public void sendMessage(ChatComponent component, ChatMessageType type, UUID uuid) { this.parser.sendMessage(this.commandSource, component, type, uuid); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + FabricChatCommandSender other = (FabricChatCommandSender) obj; + return this.parser.equals(other.parser) && this.commandSource.equals(other.commandSource); + } else { + return false; + } + } } \ No newline at end of file diff --git a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatOfflinePlayer.java b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatOfflinePlayer.java index 36bba9c..24d8c13 100644 --- a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatOfflinePlayer.java +++ b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatOfflinePlayer.java @@ -32,4 +32,15 @@ public boolean isOnline() { public ChatTeam getTeam() { return this.parser.toChatTeam(this.server.getScoreboard().getPlayerTeam(this.getName())); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + FabricChatOfflinePlayer other = (FabricChatOfflinePlayer) obj; + return this.parser.equals(other.parser) && this.server.equals(other.server) && this.gameProfile.equals(other.gameProfile); + } else { + return false; + } + } } \ No newline at end of file diff --git a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatPlayer.java b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatPlayer.java index cd6987e..69b82cd 100644 --- a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatPlayer.java +++ b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatPlayer.java @@ -45,4 +45,15 @@ public void kick(ChatComponent reason) { public void sendMessage(ChatComponent component, ChatMessageType type, UUID uuid) { this.parser.sendMessage(this.player, component, type, uuid); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + FabricChatPlayer other = (FabricChatPlayer) obj; + return this.parser.equals(other.parser) && this.player.equals(other.player); + } else { + return false; + } + } } \ No newline at end of file diff --git a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatServer.java b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatServer.java index 3380a1e..bddddd0 100644 --- a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatServer.java +++ b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatServer.java @@ -21,4 +21,15 @@ public MinecraftServer getImpl() { public void execute(IChatPlugin plugin, Runnable runnable) { this.parser.execute(this.server, plugin, runnable); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + FabricChatServer other = (FabricChatServer) obj; + return this.parser.equals(other.parser) && this.server.equals(other.server); + } else { + return false; + } + } } \ No newline at end of file diff --git a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatTeam.java b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatTeam.java index 0a34cdd..5a0059d 100644 --- a/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatTeam.java +++ b/fabric/src/main/java/vakiliner/chatcomponentapi/fabric/FabricChatTeam.java @@ -39,4 +39,15 @@ public ChatComponent getPrefix() { public ChatComponent getSuffix() { return FabricParser.fabric(this.team.getPlayerSuffix()); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + FabricChatTeam other = (FabricChatTeam) obj; + return this.parser.equals(other.parser) && this.team.equals(other.team); + } else { + return false; + } + } } \ No newline at end of file diff --git a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatCommandSender.java b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatCommandSender.java index 1c20d6e..fdc58a3 100644 --- a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatCommandSender.java +++ b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatCommandSender.java @@ -28,4 +28,15 @@ public String getName() { public void sendMessage(ChatComponent component, ChatMessageType type, UUID uuid) { this.parser.sendMessage(this.commandSource, component, type, uuid); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + ForgeChatCommandSender other = (ForgeChatCommandSender) obj; + return this.parser.equals(other.parser) && this.commandSource.equals(other.commandSource); + } else { + return false; + } + } } \ No newline at end of file diff --git a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatOfflinePlayer.java b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatOfflinePlayer.java index 35fc21e..548ddd9 100644 --- a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatOfflinePlayer.java +++ b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatOfflinePlayer.java @@ -32,4 +32,15 @@ public boolean isOnline() { public ChatTeam getTeam() { return this.parser.toChatTeam(this.server.getScoreboard().getPlayerTeam(this.getName())); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + ForgeChatOfflinePlayer other = (ForgeChatOfflinePlayer) obj; + return this.parser.equals(other.parser) && this.server.equals(other.server) && this.gameProfile.equals(other.gameProfile); + } else { + return false; + } + } } \ No newline at end of file diff --git a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatPlayer.java b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatPlayer.java index b6da683..8a6d0ee 100644 --- a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatPlayer.java +++ b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatPlayer.java @@ -45,4 +45,15 @@ public void kick(ChatComponent reason) { public void sendMessage(ChatComponent component, ChatMessageType type, UUID uuid) { this.parser.sendMessage(this.player, component, type, uuid); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + ForgeChatPlayer other = (ForgeChatPlayer) obj; + return this.parser.equals(other.parser) && this.player.equals(other.player); + } else { + return false; + } + } } \ No newline at end of file diff --git a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatServer.java b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatServer.java index 839c290..95155f2 100644 --- a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatServer.java +++ b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatServer.java @@ -21,4 +21,15 @@ public MinecraftServer getImpl() { public void execute(IChatPlugin plugin, Runnable runnable) { this.parser.execute(this.server, plugin, runnable); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + ForgeChatServer other = (ForgeChatServer) obj; + return this.parser.equals(other.parser) && this.server.equals(other.server); + } else { + return false; + } + } } \ No newline at end of file diff --git a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatTeam.java b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatTeam.java index fec35cc..723ec19 100644 --- a/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatTeam.java +++ b/forge/src/main/java/vakiliner/chatcomponentapi/forge/ForgeChatTeam.java @@ -38,4 +38,15 @@ public ChatComponent getPrefix() { public ChatComponent getSuffix() { return ForgeParser.forge(this.team.getPlayerSuffix()); } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (obj != null && this.getClass() == obj.getClass()) { + ForgeChatTeam other = (ForgeChatTeam) obj; + return this.parser.equals(other.parser) && this.team.equals(other.team); + } else { + return false; + } + } } \ No newline at end of file