Skip to content

Commit 667b711

Browse files
committed
Fix plugin channels not slicing the correct buffer on send
Was creating slice of the target buffer instead of the input :)
1 parent 47fb450 commit 667b711

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/spongepowered/common/network/PacketUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ public static net.minecraft.network.protocol.Packet<?> createLoginPayloadRequest
7575

7676
public static net.minecraft.network.protocol.Packet<?> createPlayPayload(final CustomPacketPayload.Type<? extends CustomPacketPayload> channel, final ChannelBuf payload, final EngineConnectionSide<?> side) {
7777
if (side == EngineConnectionSide.CLIENT) {
78-
return new ServerboundCustomPayloadPacket(SpongeChannelPayload.fromType(channel, (b) -> b.writeBytes((FriendlyByteBuf) payload).slice()));
78+
return new ServerboundCustomPayloadPacket(SpongeChannelPayload.fromType(channel, (b) -> b.writeBytes(((FriendlyByteBuf) payload).slice())));
7979
} else if (side == EngineConnectionSide.SERVER) {
80-
return new ClientboundCustomPayloadPacket(SpongeChannelPayload.fromType(channel, (b) -> b.writeBytes((FriendlyByteBuf) payload).slice()));
80+
return new ClientboundCustomPayloadPacket(SpongeChannelPayload.fromType(channel, (b) -> b.writeBytes(((FriendlyByteBuf) payload).slice())));
8181
} else {
8282
throw new UnsupportedOperationException();
8383
}

0 commit comments

Comments
 (0)