Fix formatting
This commit is contained in:
@@ -44,66 +44,66 @@ public enum Protocol
|
||||
|
||||
// Undef
|
||||
HANDSHAKE
|
||||
{
|
||||
{
|
||||
|
||||
{
|
||||
TO_SERVER.registerPacket( 0x00, Handshake.class );
|
||||
}
|
||||
},
|
||||
{
|
||||
TO_SERVER.registerPacket( 0x00, Handshake.class );
|
||||
}
|
||||
},
|
||||
// 0
|
||||
GAME
|
||||
{
|
||||
{
|
||||
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, 0x1F, KeepAlive.class );
|
||||
TO_CLIENT.registerPacket( 0x01, 0x23, Login.class );
|
||||
TO_CLIENT.registerPacket( 0x02, 0x0F, Chat.class );
|
||||
TO_CLIENT.registerPacket( 0x07, 0x33, Respawn.class );
|
||||
TO_CLIENT.registerPacket( 0x0C, 0x0C, BossBar.class, true );
|
||||
TO_CLIENT.registerPacket( 0x38, 0x2D, PlayerListItem.class ); // PlayerInfo
|
||||
TO_CLIENT.registerPacket( 0x3A, 0x0E, TabCompleteResponse.class );
|
||||
TO_CLIENT.registerPacket( 0x3B, 0x3F, ScoreboardObjective.class );
|
||||
TO_CLIENT.registerPacket( 0x3C, 0x42, ScoreboardScore.class );
|
||||
TO_CLIENT.registerPacket( 0x3D, 0x38, ScoreboardDisplay.class );
|
||||
TO_CLIENT.registerPacket( 0x3E, 0x41, Team.class );
|
||||
TO_CLIENT.registerPacket( 0x3F, 0x18, PluginMessage.class );
|
||||
TO_CLIENT.registerPacket( 0x40, 0x1A, Kick.class );
|
||||
TO_CLIENT.registerPacket( 0x45, 0x45, Title.class );
|
||||
TO_CLIENT.registerPacket( 0x47, 0x48, PlayerListHeaderFooter.class );
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, 0x1F, KeepAlive.class );
|
||||
TO_CLIENT.registerPacket( 0x01, 0x23, Login.class );
|
||||
TO_CLIENT.registerPacket( 0x02, 0x0F, Chat.class );
|
||||
TO_CLIENT.registerPacket( 0x07, 0x33, Respawn.class );
|
||||
TO_CLIENT.registerPacket( 0x0C, 0x0C, BossBar.class, true );
|
||||
TO_CLIENT.registerPacket( 0x38, 0x2D, PlayerListItem.class ); // PlayerInfo
|
||||
TO_CLIENT.registerPacket( 0x3A, 0x0E, TabCompleteResponse.class );
|
||||
TO_CLIENT.registerPacket( 0x3B, 0x3F, ScoreboardObjective.class );
|
||||
TO_CLIENT.registerPacket( 0x3C, 0x42, ScoreboardScore.class );
|
||||
TO_CLIENT.registerPacket( 0x3D, 0x38, ScoreboardDisplay.class );
|
||||
TO_CLIENT.registerPacket( 0x3E, 0x41, Team.class );
|
||||
TO_CLIENT.registerPacket( 0x3F, 0x18, PluginMessage.class );
|
||||
TO_CLIENT.registerPacket( 0x40, 0x1A, Kick.class );
|
||||
TO_CLIENT.registerPacket( 0x45, 0x45, Title.class );
|
||||
TO_CLIENT.registerPacket( 0x47, 0x48, PlayerListHeaderFooter.class );
|
||||
|
||||
TO_SERVER.registerPacket( 0x00, 0x0B, KeepAlive.class );
|
||||
TO_SERVER.registerPacket( 0x01, 0x02, Chat.class );
|
||||
TO_SERVER.registerPacket( 0x14, 0x01, TabCompleteRequest.class );
|
||||
TO_SERVER.registerPacket( 0x15, 0x04, ClientSettings.class );
|
||||
TO_SERVER.registerPacket( 0x17, 0x09, PluginMessage.class );
|
||||
}
|
||||
},
|
||||
TO_SERVER.registerPacket( 0x00, 0x0B, KeepAlive.class );
|
||||
TO_SERVER.registerPacket( 0x01, 0x02, Chat.class );
|
||||
TO_SERVER.registerPacket( 0x14, 0x01, TabCompleteRequest.class );
|
||||
TO_SERVER.registerPacket( 0x15, 0x04, ClientSettings.class );
|
||||
TO_SERVER.registerPacket( 0x17, 0x09, PluginMessage.class );
|
||||
}
|
||||
},
|
||||
// 1
|
||||
STATUS
|
||||
{
|
||||
{
|
||||
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, StatusResponse.class );
|
||||
TO_CLIENT.registerPacket( 0x01, PingPacket.class );
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, StatusResponse.class );
|
||||
TO_CLIENT.registerPacket( 0x01, PingPacket.class );
|
||||
|
||||
TO_SERVER.registerPacket( 0x00, StatusRequest.class );
|
||||
TO_SERVER.registerPacket( 0x01, PingPacket.class );
|
||||
}
|
||||
},
|
||||
TO_SERVER.registerPacket( 0x00, StatusRequest.class );
|
||||
TO_SERVER.registerPacket( 0x01, PingPacket.class );
|
||||
}
|
||||
},
|
||||
//2
|
||||
LOGIN
|
||||
{
|
||||
{
|
||||
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, Kick.class );
|
||||
TO_CLIENT.registerPacket( 0x01, EncryptionRequest.class );
|
||||
TO_CLIENT.registerPacket( 0x02, LoginSuccess.class );
|
||||
TO_CLIENT.registerPacket( 0x03, SetCompression.class );
|
||||
{
|
||||
TO_CLIENT.registerPacket( 0x00, Kick.class );
|
||||
TO_CLIENT.registerPacket( 0x01, EncryptionRequest.class );
|
||||
TO_CLIENT.registerPacket( 0x02, LoginSuccess.class );
|
||||
TO_CLIENT.registerPacket( 0x03, SetCompression.class );
|
||||
|
||||
TO_SERVER.registerPacket( 0x00, LoginRequest.class );
|
||||
TO_SERVER.registerPacket( 0x01, EncryptionResponse.class );
|
||||
}
|
||||
};
|
||||
TO_SERVER.registerPacket( 0x00, LoginRequest.class );
|
||||
TO_SERVER.registerPacket( 0x01, EncryptionResponse.class );
|
||||
}
|
||||
};
|
||||
/*========================================================================*/
|
||||
public static final int MAX_PACKET_ID = 0xFF;
|
||||
public static List<Integer> supportedVersions = Arrays.asList(
|
||||
@@ -129,7 +129,6 @@ public enum Protocol
|
||||
private final TIntObjectMap<TIntIntMap> packetRemap = new TIntObjectHashMap<>();
|
||||
private final TIntObjectMap<TIntIntMap> packetRemapInv = new TIntObjectHashMap<>();
|
||||
|
||||
|
||||
{
|
||||
packetRemap.put( ProtocolConstants.MINECRAFT_1_8, new TIntIntHashMap() );
|
||||
packetRemapInv.put( ProtocolConstants.MINECRAFT_1_8, new TIntIntHashMap() );
|
||||
|
@@ -54,7 +54,7 @@ public class ClientSettings extends DefinedPacket
|
||||
buf.writeByte( skinParts );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
DefinedPacket.writeVarInt(mainHand, buf);
|
||||
DefinedPacket.writeVarInt( mainHand, buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -22,11 +22,11 @@ public class PlayerListItem extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
action = Action.values()[ DefinedPacket.readVarInt( buf )];
|
||||
action = Action.values()[DefinedPacket.readVarInt( buf )];
|
||||
items = new Item[ DefinedPacket.readVarInt( buf ) ];
|
||||
for ( int i = 0; i < items.length; i++ )
|
||||
{
|
||||
Item item = items[ i ] = new Item();
|
||||
Item item = items[i] = new Item();
|
||||
item.setUuid( DefinedPacket.readUUID( buf ) );
|
||||
switch ( action )
|
||||
{
|
||||
@@ -39,13 +39,13 @@ public class PlayerListItem extends DefinedPacket
|
||||
String value = DefinedPacket.readString( buf );
|
||||
if ( buf.readBoolean() )
|
||||
{
|
||||
item.properties[ j] = new String[]
|
||||
item.properties[j] = new String[]
|
||||
{
|
||||
name, value, DefinedPacket.readString( buf )
|
||||
};
|
||||
} else
|
||||
{
|
||||
item.properties[ j ] = new String[]
|
||||
item.properties[j] = new String[]
|
||||
{
|
||||
name, value
|
||||
};
|
||||
@@ -88,12 +88,12 @@ public class PlayerListItem extends DefinedPacket
|
||||
DefinedPacket.writeVarInt( item.properties.length, buf );
|
||||
for ( String[] prop : item.properties )
|
||||
{
|
||||
DefinedPacket.writeString( prop[ 0], buf );
|
||||
DefinedPacket.writeString( prop[ 1], buf );
|
||||
DefinedPacket.writeString( prop[0], buf );
|
||||
DefinedPacket.writeString( prop[1], buf );
|
||||
if ( prop.length >= 3 )
|
||||
{
|
||||
buf.writeBoolean( true );
|
||||
DefinedPacket.writeString( prop[ 2], buf );
|
||||
DefinedPacket.writeString( prop[2], buf );
|
||||
} else
|
||||
{
|
||||
buf.writeBoolean( false );
|
||||
|
@@ -33,7 +33,7 @@ public class PluginMessage extends DefinedPacket
|
||||
{
|
||||
tag = readString( buf );
|
||||
int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000;
|
||||
Preconditions.checkArgument(buf.readableBytes() < maxSize);
|
||||
Preconditions.checkArgument( buf.readableBytes() < maxSize );
|
||||
data = new byte[ buf.readableBytes() ];
|
||||
buf.readBytes( data );
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@ public class Team extends DefinedPacket
|
||||
nameTagVisibility = readString( buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
collisionRule = readString(buf);
|
||||
collisionRule = readString( buf );
|
||||
}
|
||||
color = buf.readByte();
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class Team extends DefinedPacket
|
||||
writeString( nameTagVisibility, buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_9 )
|
||||
{
|
||||
writeString( collisionRule, buf);
|
||||
writeString( collisionRule, buf );
|
||||
}
|
||||
buf.writeByte( color );
|
||||
}
|
||||
|
Reference in New Issue
Block a user