diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java index 34103f52d..abd1f7b91 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java @@ -146,7 +146,7 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { .thenAcceptAsync(pme -> { if (pme.getResult().isAllowed() && !playerConnection.isClosed()) { PluginMessage copied = new PluginMessage(packet.getChannel(), - Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(copy))); + Unpooled.wrappedBuffer(copy)); playerConnection.write(copied); } }, playerConnection.eventLoop()) 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 ae6d3bb3d..5757b3040 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 @@ -225,12 +225,11 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { backendConn.write(packet.retain()); } else { byte[] copy = ByteBufUtil.getBytes(packet.content()); - PluginMessageEvent event = new PluginMessageEvent(player, serverConn, id, - ByteBufUtil.getBytes(packet.content())); + PluginMessageEvent event = new PluginMessageEvent(player, serverConn, id, copy); server.getEventManager().fire(event).thenAcceptAsync(pme -> { if (pme.getResult().isAllowed()) { PluginMessage message = new PluginMessage(packet.getChannel(), - Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(copy))); + Unpooled.wrappedBuffer(copy)); backendConn.write(message); } }, backendConn.eventLoop())