From 5a515f37a36d8af19da0b9f526d75fc122d955bd Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 28 Jul 2020 16:50:34 -0400 Subject: [PATCH] Add missing allowed check. Fixes #335 --- .../proxy/connection/client/ClientPlaySessionHandler.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index ec9d9472b..e75873262 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -219,9 +219,11 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { PluginMessageEvent event = new PluginMessageEvent(player, serverConn, id, ByteBufUtil.getBytes(packet.content())); server.getEventManager().fire(event).thenAcceptAsync(pme -> { - PluginMessage message = new PluginMessage(packet.getChannel(), - Unpooled.wrappedBuffer(copy)); - backendConn.write(message); + if (pme.getResult().isAllowed()) { + PluginMessage message = new PluginMessage(packet.getChannel(), + Unpooled.wrappedBuffer(copy)); + backendConn.write(message); + } }, backendConn.eventLoop()); } }