Fix dimension switch handling in 20w14infinite->1.16

This commit is contained in:
FlorianMichael 2024-09-15 22:34:12 +02:00
parent 9dea6be04c
commit 072b6de189
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -91,6 +91,8 @@ public class EntityPacketRewriter20w14infinite extends EntityRewriter<Clientboun
map(Types.LONG); // Seed
map(Types.UNSIGNED_BYTE); // Gamemode
handler(wrapper -> {
tracker(wrapper.user()).clearEntities();
wrapper.write(Types.BYTE, (byte) -1); // Previous gamemode, set to none
final String levelType = wrapper.read(Types.STRING);
@ -113,9 +115,8 @@ public class EntityPacketRewriter20w14infinite extends EntityRewriter<Clientboun
handler(DIMENSION_HANDLER); // Dimension
map(Types.LONG); // Seed
map(Types.UNSIGNED_BYTE); // Max players
handler(playerTrackerHandler());
handler(wrapper -> {
wrapper.user().getEntityTracker(Protocol20w14infiniteTo1_16.class).addEntity(wrapper.get(Types.INT, 0), EntityTypes1_16.PLAYER);
final String type = wrapper.read(Types.STRING);// level type
wrapper.passthrough(Types.VAR_INT); // View distance
wrapper.passthrough(Types.BOOLEAN); // Reduced debug info