1.8 isn't a snapshot anymore
This commit is contained in:
@@ -104,7 +104,7 @@ public enum Protocol
|
||||
public static List<Integer> supportedVersions = Arrays.asList(
|
||||
ProtocolConstants.MINECRAFT_1_7_2,
|
||||
ProtocolConstants.MINECRAFT_1_7_6,
|
||||
ProtocolConstants.MINECRAFT_SNAPSHOT
|
||||
ProtocolConstants.MINECRAFT_1_8
|
||||
);
|
||||
/*========================================================================*/
|
||||
public final DirectionData TO_SERVER = new DirectionData( ProtocolConstants.Direction.TO_SERVER );
|
||||
|
@@ -5,7 +5,7 @@ public class ProtocolConstants
|
||||
|
||||
public static final int MINECRAFT_1_7_2 = 4;
|
||||
public static final int MINECRAFT_1_7_6 = 5;
|
||||
public static final int MINECRAFT_SNAPSHOT = 47;
|
||||
public static final int MINECRAFT_1_8 = 47;
|
||||
|
||||
public enum Direction
|
||||
{
|
||||
|
@@ -28,7 +28,7 @@ public class Chat extends DefinedPacket
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
message = readString( buf );
|
||||
if ( direction == ProtocolConstants.Direction.TO_CLIENT && protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( direction == ProtocolConstants.Direction.TO_CLIENT && protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
position = buf.readByte();
|
||||
}
|
||||
@@ -38,7 +38,7 @@ public class Chat extends DefinedPacket
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( message, buf );
|
||||
if ( direction == ProtocolConstants.Direction.TO_CLIENT && protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( direction == ProtocolConstants.Direction.TO_CLIENT && protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
buf.writeByte( position );
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ public class EncryptionRequest extends DefinedPacket
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
serverId = readString( buf );
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
publicKey = readArrayLegacy( buf );
|
||||
verifyToken = readArrayLegacy( buf );
|
||||
@@ -39,7 +39,7 @@ public class EncryptionRequest extends DefinedPacket
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( serverId, buf );
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeArrayLegacy( publicKey, buf, false );
|
||||
writeArrayLegacy( verifyToken, buf, false );
|
||||
|
@@ -22,7 +22,7 @@ public class EncryptionResponse extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
sharedSecret = readArrayLegacy( buf );
|
||||
verifyToken = readArrayLegacy( buf );
|
||||
@@ -36,7 +36,7 @@ public class EncryptionResponse extends DefinedPacket
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeArrayLegacy( sharedSecret, buf, false );
|
||||
writeArrayLegacy( verifyToken, buf, false );
|
||||
|
@@ -21,7 +21,7 @@ public class KeepAlive extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
randomId = readVarInt( buf );
|
||||
} else
|
||||
@@ -33,7 +33,7 @@ public class KeepAlive extends DefinedPacket
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeVarInt( randomId, buf );
|
||||
} else
|
||||
|
@@ -9,8 +9,6 @@ import net.md_5.bungee.protocol.AbstractPacketHandler;
|
||||
import net.md_5.bungee.protocol.ProtocolConstants;
|
||||
|
||||
import java.util.UUID;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@@ -24,7 +22,7 @@ public class PlayerListItem extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
items = new Item[ 1 ];
|
||||
Item item = items[ 0 ] = new Item();
|
||||
@@ -88,7 +86,7 @@ public class PlayerListItem extends DefinedPacket
|
||||
@Override
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
Item item = items[0]; // Only one at a time
|
||||
writeString( item.displayName, buf ); // TODO: Server unique only!
|
||||
|
@@ -33,7 +33,7 @@ public class PluginMessage extends DefinedPacket
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
tag = readString( buf );
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
data = readArrayLegacy( buf );
|
||||
} else
|
||||
@@ -47,7 +47,7 @@ public class PluginMessage extends DefinedPacket
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( tag, buf );
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeArrayLegacy( data, buf, allowExtendedPacket );
|
||||
} else
|
||||
|
@@ -33,7 +33,7 @@ public class ScoreboardObjective extends DefinedPacket
|
||||
value = readString( buf );
|
||||
}
|
||||
action = buf.readByte();
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT && ( action == 0 || action == 2 ) )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 && ( action == 0 || action == 2 ) )
|
||||
{
|
||||
value = readString( buf );
|
||||
type = readString( buf );
|
||||
@@ -49,7 +49,7 @@ public class ScoreboardObjective extends DefinedPacket
|
||||
writeString( value, buf );
|
||||
}
|
||||
buf.writeByte( action );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT && ( action == 0 || action == 2 ) )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 && ( action == 0 || action == 2 ) )
|
||||
{
|
||||
writeString( value, buf );
|
||||
writeString( type, buf );
|
||||
|
@@ -29,7 +29,7 @@ public class ScoreboardScore extends DefinedPacket
|
||||
{
|
||||
itemName = readString( buf );
|
||||
action = buf.readByte();
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
scoreName = readString( buf );
|
||||
if ( action != 1 )
|
||||
@@ -51,7 +51,7 @@ public class ScoreboardScore extends DefinedPacket
|
||||
{
|
||||
writeString( itemName, buf );
|
||||
buf.writeByte( action );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeString( scoreName, buf );
|
||||
if ( action != 1 )
|
||||
|
@@ -24,7 +24,7 @@ public class TabCompleteRequest extends DefinedPacket
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
cursor = readString( buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
if ( hasPositon = buf.readBoolean() )
|
||||
{
|
||||
@@ -37,7 +37,7 @@ public class TabCompleteRequest extends DefinedPacket
|
||||
public void write(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
writeString( cursor, buf );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
buf.writeBoolean( hasPositon );
|
||||
if ( hasPositon )
|
||||
|
@@ -50,7 +50,7 @@ public class Team extends DefinedPacket
|
||||
prefix = readString( buf );
|
||||
suffix = readString( buf );
|
||||
friendlyFire = buf.readByte();
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
nameTagVisibility = readString( buf );
|
||||
color = buf.readByte();
|
||||
@@ -58,7 +58,7 @@ public class Team extends DefinedPacket
|
||||
}
|
||||
if ( mode == 0 || mode == 3 || mode == 4 )
|
||||
{
|
||||
int len = ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT ) ? readVarInt( buf ) : buf.readShort();
|
||||
int len = ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 ) ? readVarInt( buf ) : buf.readShort();
|
||||
players = new String[ len ];
|
||||
for ( int i = 0; i < len; i++ )
|
||||
{
|
||||
@@ -78,7 +78,7 @@ public class Team extends DefinedPacket
|
||||
writeString( prefix, buf );
|
||||
writeString( suffix, buf );
|
||||
buf.writeByte( friendlyFire );
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeString( nameTagVisibility, buf );
|
||||
buf.writeByte( color );
|
||||
@@ -86,7 +86,7 @@ public class Team extends DefinedPacket
|
||||
}
|
||||
if ( mode == 0 || mode == 3 || mode == 4 )
|
||||
{
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_SNAPSHOT )
|
||||
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_8 )
|
||||
{
|
||||
writeVarInt( players.length, buf );
|
||||
} else
|
||||
|
Reference in New Issue
Block a user