diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java index 58eb1f61..6ca80e2b 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Login.java @@ -74,7 +74,7 @@ public class Login extends DefinedPacket dimension = buf.readInt(); } else { - dimension = buf.readByte(); + dimension = (int) buf.readByte(); } if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 ) { @@ -138,10 +138,10 @@ public class Login extends DefinedPacket writeString( worldName, buf ); } else if ( protocolVersion > ProtocolConstants.MINECRAFT_1_9 ) { - buf.writeInt( ( (Number) dimension ).intValue() ); + buf.writeInt( (Integer) dimension ); } else { - buf.writeByte( ( (Number) dimension ).byteValue() ); + buf.writeByte( (Integer) dimension ); } if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 ) { diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java index 6a8c9c54..0d8068ea 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/packet/Respawn.java @@ -68,7 +68,7 @@ public class Respawn extends DefinedPacket writeString( worldName, buf ); } else { - buf.writeInt( ( (Number) dimension ).intValue() ); + buf.writeInt( ( (Integer) dimension ) ); } if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_15 ) { diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 5c3c1ece..23a43b92 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -263,12 +263,12 @@ public class ServerConnector extends PacketHandler { Object newDim; String worldName = login.getWorldName(); - if ( login.getDimension() instanceof Number ) + if ( login.getDimension() instanceof Integer ) { - newDim = ( ( (Number) login.getDimension() ).intValue() >= 0 ? -1 : 0 ); + newDim = ( (Integer) login.getDimension() >= 0 ? -1 : 0 ); } else { - newDim = worldName = ( "minecraft:overworld".equals( login.getDimension() ) ) ? "minecraft:the_nether" : "minecraft:overworld"; + newDim = worldName = ( "minecraft:overworld".equals( (String) login.getDimension() ) ) ? "minecraft:the_nether" : "minecraft:overworld"; } user.unsafe().sendPacket( new Respawn( newDim, worldName, login.getSeed(), login.getDifficulty(), login.getGameMode(), login.getPreviousGameMode(), login.getLevelType(), login.isDebug(), login.isFlat(), false ) );