From 00759e52790e85e148efc08adb7e7dd29e6c5110 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 3 Aug 2026 14:09:05 +0100 Subject: [PATCH] Revert "Fix dimension reading for some mods that add extra dimensions in 1.7.10 (#1734)" This reverts commit 2676520c6a54bac0529544793c982dd701b338d9. --- .../proxy/protocol/packet/JoinGamePacket.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGamePacket.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGamePacket.java index 31b03911..645dc7b6 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGamePacket.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGamePacket.java @@ -245,17 +245,7 @@ public class JoinGamePacket implements MinecraftPacket { if (version.noLessThan(ProtocolVersion.MINECRAFT_1_9_1)) { this.dimension = buf.readInt(); } else { - // Vanilla 1.7.10 uses a signed byte for dimension (-1 Nether, 0 Overworld, 1 End). - // Modded servers hack this to an unsigned byte to allow dim IDs up to 255. - // We must store the canonical int here because RespawnPacket.fromJoinGame copies this - // value into a packet that encodes dimension as a 4-byte int (RespawnPacket.encode, - // pre-1.16 logic). Sign-extending a modded byte like 0xB4 to int -76 sends an - // illegal dimension ID to the client and crashes it. - // - // The wire byte is ambiguous: 0xFF could be vanilla Nether (-1) or modded dim 255. - // We resolve in Nether's favor since vanilla 1.7.10 only ever uses -1/0/1. - short raw = buf.readUnsignedByte(); - this.dimension = raw == 0xFF ? -1 : raw; + this.dimension = buf.readByte(); } if (version.noGreaterThan(ProtocolVersion.MINECRAFT_1_13_2)) { this.difficulty = buf.readUnsignedByte();