Fixed max player count value mapping (#541)

This commit is contained in:
RK_01 2023-03-31 09:40:18 +02:00 committed by GitHub
parent 8eaadd0f18
commit b174dd31b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,7 @@ public class EntityPackets1_16_2 extends EntityRewriter<ClientboundPackets1_16_2
map(Type.LONG); // Seed
handler(wrapper -> {
int maxPlayers = wrapper.read(Type.VAR_INT);
wrapper.write(Type.UNSIGNED_BYTE, (short) Math.max(maxPlayers, 255));
wrapper.write(Type.UNSIGNED_BYTE, (short) Math.min(maxPlayers, 255));
});
// ...
handler(getTrackerHandler(Entity1_16_2Types.PLAYER, Type.INT));