fix: copy packet buffer in ClientOnEntityLoad to fix a weird crash

This commit is contained in:
Octol1ttle 2023-10-31 10:29:03 +05:00
parent 38394d5c28
commit 22a7d5b036
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -81,7 +81,7 @@ public class KnockdownsClient implements ClientModInitializer {
PacketByteBuf buf = PacketByteBufs.create(); PacketByteBuf buf = PacketByteBufs.create();
buf.writeUuid(entity.getUuid()); buf.writeUuid(entity.getUuid());
ClientPlayNetworking.send(KnockdownsNetworkingConstants.C2S_REQUEST_PLAYER_KNOCKED_DOWN, buf); ClientPlayNetworking.send(KnockdownsNetworkingConstants.C2S_REQUEST_PLAYER_KNOCKED_DOWN, PacketByteBufs.copy(buf));
ClientPlayNetworking.send(KnockdownsNetworkingConstants.C2S_REQUEST_PLAYER_REVIVING, buf); ClientPlayNetworking.send(KnockdownsNetworkingConstants.C2S_REQUEST_PLAYER_REVIVING, buf);
} }
}); });