Add equals/hashCode to all results and remove another result I don't like

Fixes #483
This commit is contained in:
Andrew Steinborn
2021-05-11 06:52:46 -04:00
parent f4fc07768b
commit 47a1332514
7 changed files with 155 additions and 80 deletions

View File

@@ -175,14 +175,8 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
PlayerChatEvent event = new PlayerChatEventImpl(player, msg);
server.eventManager().fire(event)
.thenAcceptAsync(pme -> {
PlayerChatEventImpl.ChatResult chatResult = pme.result();
if (chatResult.isAllowed()) {
Optional<String> eventMsg = pme.result().modifiedMessage();
if (eventMsg.isPresent()) {
smc.write(new ServerboundChatPacket(eventMsg.get()));
} else {
smc.write(packet);
}
if (pme.result().isAllowed()) {
smc.write(new ServerboundChatPacket(pme.currentMessage()));
}
}, smc.eventLoop())
.exceptionally((ex) -> {