mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
Add equals/hashCode to all results and remove another result I don't like
Fixes #483
This commit is contained in:
@@ -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) -> {
|
||||
|
||||
Reference in New Issue
Block a user