Minecraft 1.12.2 Pre-release 1 Support

This commit is contained in:
Myles 2017-09-13 15:45:45 +01:00
parent 298835be42
commit c7c61df0b8
10 changed files with 46 additions and 8 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -37,7 +37,7 @@
<dependency>
<groupId>us.myles</groupId>
<artifactId>viaversion-common</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</dependency>
</dependencies>
</project>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -9,6 +9,7 @@ import us.myles.ViaVersion.protocols.protocol1_10to1_9_3.Protocol1_10To1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_11_1to1_11.Protocol1_11_1To1_11;
import us.myles.ViaVersion.protocols.protocol1_11to1_10.Protocol1_11To1_10;
import us.myles.ViaVersion.protocols.protocol1_12_1to1_12.Protocol1_12_1TO1_12;
import us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1.Protocol1_12_2TO1_12_1;
import us.myles.ViaVersion.protocols.protocol1_12to1_11_1.Protocol1_12To1_11_1;
import us.myles.ViaVersion.protocols.protocol1_9_1_2to1_9_3_4.Protocol1_9_1_2TO1_9_3_4;
import us.myles.ViaVersion.protocols.protocol1_9_1to1_9.Protocol1_9_1TO1_9;
@ -45,6 +46,7 @@ public class ProtocolRegistry {
registerProtocol(new Protocol1_12To1_11_1(), Collections.singletonList(ProtocolVersion.v1_12.getId()), ProtocolVersion.v1_11_1.getId());
registerProtocol(new Protocol1_12_1TO1_12(), Collections.singletonList(ProtocolVersion.v1_12_1.getId()), ProtocolVersion.v1_12.getId());
registerProtocol(new Protocol1_12_2TO1_12_1(), Collections.singletonList(ProtocolVersion.v1_12_2.getId()), ProtocolVersion.v1_12_1.getId());
}
/**

View File

@ -31,6 +31,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_11_1;
public static final ProtocolVersion v1_12;
public static final ProtocolVersion v1_12_1;
public static final ProtocolVersion v1_12_2;
public static final ProtocolVersion unknown;
private final int id;
@ -58,6 +59,7 @@ public class ProtocolVersion {
register(v1_11_1 = new ProtocolVersion(316, "1.11.1"));
register(v1_12 = new ProtocolVersion(335, "1.12"));
register(v1_12_1 = new ProtocolVersion(338, "1.12.1"));
register(v1_12_2 = new ProtocolVersion(339, "1.12.2-PR1"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}

View File

@ -0,0 +1,34 @@
package us.myles.ViaVersion.protocols.protocol1_12_2to1_12_1;
import us.myles.ViaVersion.api.data.UserConnection;
import us.myles.ViaVersion.api.protocol.Protocol;
import us.myles.ViaVersion.api.remapper.PacketRemapper;
import us.myles.ViaVersion.api.type.Type;
import us.myles.ViaVersion.packets.State;
public class Protocol1_12_2TO1_12_1 extends Protocol {
@Override
protected void registerPackets() {
// Outgoing
// 0x1f - Keep alive
registerOutgoing(State.PLAY, 0x1f, 0x1f, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT, Type.LONG);
}
}); // Keep alive
// Incoming
// 0xb - Keep alive
registerIncoming(State.PLAY, 0xb, 0xb, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.LONG, Type.VAR_INT);
}
});
}
@Override
public void init(UserConnection userConnection) {
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<name>viaversion-jar</name>

View File

@ -6,7 +6,7 @@
<groupId>us.myles</groupId>
<artifactId>viaversion-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
<packaging>pom</packaging>
<name>viaversion-parent</name>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1-1.12.2-PR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>