Minecraft 1.13.2 support

This commit is contained in:
md_5 2018-10-23 06:00:00 +11:00
parent bba5098ff1
commit 1c5bff7ed7
5 changed files with 13 additions and 5 deletions

View File

@ -22,7 +22,7 @@
<dependency> <dependency>
<groupId>org.yaml</groupId> <groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId> <artifactId>snakeyaml</artifactId>
<version>1.21</version> <version>1.23</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -377,7 +377,8 @@ public enum Protocol
ProtocolConstants.MINECRAFT_1_12_2 ProtocolConstants.MINECRAFT_1_12_2
) ); ) );
linkedProtocols.put( ProtocolConstants.MINECRAFT_1_13, Arrays.asList( linkedProtocols.put( ProtocolConstants.MINECRAFT_1_13, Arrays.asList(
ProtocolConstants.MINECRAFT_1_13_1 ProtocolConstants.MINECRAFT_1_13_1,
ProtocolConstants.MINECRAFT_1_13_2
) ); ) );
} }

View File

@ -19,6 +19,7 @@ public class ProtocolConstants
public static final int MINECRAFT_1_12_2 = 340; public static final int MINECRAFT_1_12_2 = 340;
public static final int MINECRAFT_1_13 = 393; public static final int MINECRAFT_1_13 = 393;
public static final int MINECRAFT_1_13_1 = 401; public static final int MINECRAFT_1_13_1 = 401;
public static final int MINECRAFT_1_13_2 = 404;
public static final List<String> SUPPORTED_VERSIONS = Arrays.asList( public static final List<String> SUPPORTED_VERSIONS = Arrays.asList(
"1.8.x", "1.8.x",
"1.9.x", "1.9.x",
@ -39,7 +40,8 @@ public class ProtocolConstants
ProtocolConstants.MINECRAFT_1_12_1, ProtocolConstants.MINECRAFT_1_12_1,
ProtocolConstants.MINECRAFT_1_12_2, ProtocolConstants.MINECRAFT_1_12_2,
ProtocolConstants.MINECRAFT_1_13, ProtocolConstants.MINECRAFT_1_13,
ProtocolConstants.MINECRAFT_1_13_1 ProtocolConstants.MINECRAFT_1_13_1,
ProtocolConstants.MINECRAFT_1_13_2
); );
public enum Direction public enum Direction

View File

@ -87,7 +87,7 @@
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version> <version>5.1.47</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -49,6 +49,7 @@ public abstract class EntityMap
return EntityMap_1_12_1.INSTANCE; return EntityMap_1_12_1.INSTANCE;
case ProtocolConstants.MINECRAFT_1_13: case ProtocolConstants.MINECRAFT_1_13:
case ProtocolConstants.MINECRAFT_1_13_1: case ProtocolConstants.MINECRAFT_1_13_1:
case ProtocolConstants.MINECRAFT_1_13_2:
return EntityMap_1_13.INSTANCE; return EntityMap_1_13.INSTANCE;
} }
throw new RuntimeException( "Version " + version + " has no entity map" ); throw new RuntimeException( "Version " + version + " has no entity map" );
@ -241,8 +242,12 @@ public abstract class EntityMap
private static void readSkipSlot(ByteBuf packet, int protocolVersion) private static void readSkipSlot(ByteBuf packet, int protocolVersion)
{ {
if ( packet.readShort() != -1 ) if ( (protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2) ? packet.readBoolean() : packet.readShort() != -1 )
{ {
if ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13_2 )
{
DefinedPacket.readVarInt( packet );
}
packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short packet.skipBytes( ( protocolVersion >= ProtocolConstants.MINECRAFT_1_13 ) ? 1 : 3 ); // byte vs byte, short
int position = packet.readerIndex(); int position = packet.readerIndex();