Latest snapshot. Doesnt seem to be worky though
This commit is contained in:
		| @@ -92,8 +92,8 @@ public enum Protocol | ||||
|     }; | ||||
|     /*========================================================================*/ | ||||
|     public static final int MAX_PACKET_ID = 0xFF; | ||||
|     public static final int PROTOCOL_VERSION = 0x00; | ||||
|     public static final String MINECRAFT_VERSION = "13w41b"; | ||||
|     public static final int PROTOCOL_VERSION = 0x01; | ||||
|     public static final String MINECRAFT_VERSION = "13w42b"; | ||||
|     /*========================================================================*/ | ||||
|     public final ProtocolDirection TO_SERVER = new ProtocolDirection( "TO_SERVER" ); | ||||
|     public final ProtocolDirection TO_CLIENT = new ProtocolDirection( "TO_CLIENT" ); | ||||
|   | ||||
| @@ -20,6 +20,7 @@ public class Login extends DefinedPacket | ||||
|     private int dimension; | ||||
|     private short difficulty; | ||||
|     private short maxPlayers; | ||||
|     private String levelType; | ||||
|  | ||||
|     @Override | ||||
|     public void read(ByteBuf buf) | ||||
| @@ -29,6 +30,7 @@ public class Login extends DefinedPacket | ||||
|         dimension = buf.readByte(); | ||||
|         difficulty = buf.readUnsignedByte(); | ||||
|         maxPlayers = buf.readUnsignedByte(); | ||||
|         levelType = readString( buf ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
| @@ -39,6 +41,7 @@ public class Login extends DefinedPacket | ||||
|         buf.writeByte( dimension ); | ||||
|         buf.writeByte( difficulty ); | ||||
|         buf.writeByte( maxPlayers ); | ||||
|         writeString( levelType, buf ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
| @@ -18,6 +18,7 @@ public class Respawn extends DefinedPacket | ||||
|     private int dimension; | ||||
|     private short difficulty; | ||||
|     private short gameMode; | ||||
|     private String levelType; | ||||
|  | ||||
|     @Override | ||||
|     public void read(ByteBuf buf) | ||||
| @@ -25,6 +26,7 @@ public class Respawn extends DefinedPacket | ||||
|         dimension = buf.readInt(); | ||||
|         difficulty = buf.readUnsignedByte(); | ||||
|         gameMode = buf.readUnsignedByte(); | ||||
|         levelType = readString( buf ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
| @@ -33,6 +35,7 @@ public class Respawn extends DefinedPacket | ||||
|         buf.writeInt( dimension ); | ||||
|         buf.writeByte( difficulty ); | ||||
|         buf.writeByte( gameMode ); | ||||
|         writeString( levelType, buf ); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
| @@ -7,8 +7,8 @@ import net.md_5.bungee.protocol.packet.PluginMessage; | ||||
| public class PacketConstants | ||||
| { | ||||
|  | ||||
|     public static final Respawn DIM1_SWITCH = new Respawn( (byte) 1, (byte) 0, (byte) 0 ); | ||||
|     public static final Respawn DIM2_SWITCH = new Respawn( (byte) -1, (byte) 0, (byte) 0 ); | ||||
|     public static final Respawn DIM1_SWITCH = new Respawn( (byte) 1, (byte) 0, (byte) 0, "default" ); | ||||
|     public static final Respawn DIM2_SWITCH = new Respawn( (byte) -1, (byte) 0, (byte) 0, "default" ); | ||||
|     public static final ClientStatus CLIENT_LOGIN = new ClientStatus( (byte) 0 ); | ||||
|     public static final PluginMessage FORGE_MOD_REQUEST = new PluginMessage( "FML", new byte[] | ||||
|     { | ||||
|   | ||||
| @@ -131,7 +131,7 @@ public class ServerConnector extends PacketHandler | ||||
|  | ||||
|                 // Set tab list size, this sucks balls, TODO: what shall we do about packet mutability | ||||
|                 Login modLogin = new Login( login.getEntityId(), login.getGameMode(), (byte) login.getDimension(), login.getDifficulty(), | ||||
|                         (byte) user.getPendingConnection().getListener().getTabListSize() ); | ||||
|                         (byte) user.getPendingConnection().getListener().getTabListSize(), login.getLevelType() ); | ||||
|  | ||||
|                 user.unsafe().sendPacket( modLogin ); | ||||
|  | ||||
| @@ -156,7 +156,7 @@ public class ServerConnector extends PacketHandler | ||||
|                 user.sendDimensionSwitch(); | ||||
|  | ||||
|                 user.setServerEntityId( login.getEntityId() ); | ||||
|                 user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getDifficulty(), login.getGameMode() ) ); | ||||
|                 user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getDifficulty(), login.getGameMode(), login.getLevelType() ) ); | ||||
|  | ||||
|                 // Remove from old servers | ||||
|                 user.getServer().setObsolete( true ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 md_5
					md_5