This commit is contained in:
Gerrygames 2019-04-05 18:48:38 +02:00
parent 3ef8aa9e7f
commit 8231b3aebe
14 changed files with 90 additions and 76 deletions

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -67,7 +67,7 @@ public class ProtocolVersion {
register(v1_13 = new ProtocolVersion(393, "1.13"));
register(v1_13_1 = new ProtocolVersion(401, "1.13.1"));
register(v1_13_2 = new ProtocolVersion(404, "1.13.2"));
register(v1_14 = new ProtocolVersion(470, "1.14"));
register(v1_14 = new ProtocolVersion(471, "1.14"));
register(unknown = new ProtocolVersion(-1, "UNKNOWN"));
}

View File

@ -29,13 +29,30 @@ public class Protocol1_14To1_13_2 extends Protocol {
WorldPackets.register(this);
PlayerPackets.register(this);
registerOutgoing(State.PLAY, 0x2D, 0x2E);
registerOutgoing(State.PLAY, 0x2E, 0x2F);
registerOutgoing(State.PLAY, 0x2F, 0x30);
registerOutgoing(State.PLAY, 0x30, 0x31);
registerOutgoing(State.PLAY, 0x31, 0x32);
registerOutgoing(State.PLAY, 0x16, 0x15);
registerOutgoing(State.PLAY, 0x18, 0x17);
registerOutgoing(State.PLAY, 0x1A, 0x19);
registerOutgoing(State.PLAY, 0x1B, 0x1A);
registerOutgoing(State.PLAY, 0x1C, 0x1B);
registerOutgoing(State.PLAY, 0x1D, 0x54);
registerOutgoing(State.PLAY, 0x1E, 0x1C);
registerOutgoing(State.PLAY, 0x1F, 0x1D);
registerOutgoing(State.PLAY, 0x20, 0x1E);
registerOutgoing(State.PLAY, 0x21, 0x20);
registerOutgoing(State.PLAY, 0x27, 0x2B);
registerOutgoing(State.PLAY, 0x2B, 0x2C);
registerOutgoing(State.PLAY, 0x2D, 0x30);
registerOutgoing(State.PLAY, 0x2E, 0x31);
registerOutgoing(State.PLAY, 0x2F, 0x32);
registerOutgoing(State.PLAY, 0x30, 0x33);
registerOutgoing(State.PLAY, 0x31, 0x34);
// Position and look
registerOutgoing(State.PLAY, 0x32, 0x33, new PacketRemapper() {
registerOutgoing(State.PLAY, 0x32, 0x35, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -48,35 +65,34 @@ public class Protocol1_14To1_13_2 extends Protocol {
}
});
//TODO remove if packet ids stay unchanged in 1.14 release
registerOutgoing(State.PLAY, 0x34, 0x34);
registerOutgoing(State.PLAY, 0x34, 0x36);
registerOutgoing(State.PLAY, 0x36, 0x36);
registerOutgoing(State.PLAY, 0x37, 0x37);
registerOutgoing(State.PLAY, 0x36, 0x38);
registerOutgoing(State.PLAY, 0x37, 0x39);
registerOutgoing(State.PLAY, 0x39, 0x39);
registerOutgoing(State.PLAY, 0x3A, 0x3A);
registerOutgoing(State.PLAY, 0x3B, 0x3B);
registerOutgoing(State.PLAY, 0x3C, 0x3C);
registerOutgoing(State.PLAY, 0x3D, 0x3D);
registerOutgoing(State.PLAY, 0x3E, 0x3E);
registerOutgoing(State.PLAY, 0x39, 0x3B);
registerOutgoing(State.PLAY, 0x3A, 0x3C);
registerOutgoing(State.PLAY, 0x3B, 0x3D);
registerOutgoing(State.PLAY, 0x3C, 0x3E);
registerOutgoing(State.PLAY, 0x3D, 0x3F);
registerOutgoing(State.PLAY, 0x3E, 0x42);
registerOutgoing(State.PLAY, 0x40, 0x40);
registerOutgoing(State.PLAY, 0x41, 0x41);
registerOutgoing(State.PLAY, 0x40, 0x44);
registerOutgoing(State.PLAY, 0x41, 0x45);
registerOutgoing(State.PLAY, 0x43, 0x43);
registerOutgoing(State.PLAY, 0x44, 0x44);
registerOutgoing(State.PLAY, 0x45, 0x45);
registerOutgoing(State.PLAY, 0x46, 0x46);
registerOutgoing(State.PLAY, 0x47, 0x47);
registerOutgoing(State.PLAY, 0x48, 0x48);
registerOutgoing(State.PLAY, 0x43, 0x47);
registerOutgoing(State.PLAY, 0x44, 0x48);
registerOutgoing(State.PLAY, 0x45, 0x49);
registerOutgoing(State.PLAY, 0x46, 0x4A);
registerOutgoing(State.PLAY, 0x47, 0x4B);
registerOutgoing(State.PLAY, 0x48, 0x4C);
registerOutgoing(State.PLAY, 0x4A, 0x4A);
registerOutgoing(State.PLAY, 0x4B, 0x4B);
registerOutgoing(State.PLAY, 0x4C, 0x4C);
registerOutgoing(State.PLAY, 0x4A, 0x4E);
registerOutgoing(State.PLAY, 0x4B, 0x4F);
registerOutgoing(State.PLAY, 0x4C, 0x52);
// Sound Effect
registerOutgoing(State.PLAY, 0x4D, 0x4D, new PacketRemapper() {
registerOutgoing(State.PLAY, 0x4D, 0x51, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Sound Id
@ -88,11 +104,11 @@ public class Protocol1_14To1_13_2 extends Protocol {
});
}
});
registerOutgoing(State.PLAY, 0x4E, 0x4F);
registerOutgoing(State.PLAY, 0x4F, 0x50);
registerOutgoing(State.PLAY, 0x50, 0x51);
registerOutgoing(State.PLAY, 0x4E, 0x53);
registerOutgoing(State.PLAY, 0x4F, 0x55);
registerOutgoing(State.PLAY, 0x50, 0x56);
registerOutgoing(State.PLAY, 0x51, 0x52, new PacketRemapper() {
registerOutgoing(State.PLAY, 0x51, 0x57, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -133,10 +149,10 @@ public class Protocol1_14To1_13_2 extends Protocol {
}
});
registerOutgoing(State.PLAY, 0x52, 0x53);
registerOutgoing(State.PLAY, 0x53, 0x54);
registerOutgoing(State.PLAY, 0x52, 0x58);
registerOutgoing(State.PLAY, 0x53, 0x59);
registerOutgoing(State.PLAY, 0x55, 0x56, new PacketRemapper() {
registerOutgoing(State.PLAY, 0x55, 0x5B, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -202,12 +218,12 @@ public class Protocol1_14To1_13_2 extends Protocol {
registerIncoming(State.PLAY, 0x0C, 0x0D);
registerIncoming(State.PLAY, 0x0D, 0x0E);
registerIncoming(State.PLAY, -1, 0x0F); //Lock Difficulty packet added in 19w11a
registerIncoming(State.PLAY, 0x0E, 0x10);
registerIncoming(State.PLAY, 0x0F, 0x11);
registerIncoming(State.PLAY, 0x10, 0x12);
registerIncoming(State.PLAY, 0x11, 0x13);
registerIncoming(State.PLAY, 0x12, 0x14);
registerIncoming(State.PLAY, -1, 0x10); //Lock Difficulty packet added in 19w11a
registerIncoming(State.PLAY, 0x0E, 0x0F);
registerIncoming(State.PLAY, 0x0F, 0x14);
registerIncoming(State.PLAY, 0x10, 0x11);
registerIncoming(State.PLAY, 0x11, 0x12);
registerIncoming(State.PLAY, 0x12, 0x13);
registerIncoming(State.PLAY, 0x13, 0x15);
registerIncoming(State.PLAY, 0x14, 0x16);
registerIncoming(State.PLAY, 0x15, 0x17);

View File

@ -28,7 +28,7 @@ public class EntityPackets {
public static void register(Protocol protocol) {
// Spawn entity
protocol.registerOutgoing(State.PLAY, 0x0, 0x0, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x00, 0x00, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity id
@ -92,7 +92,7 @@ public class EntityPackets {
});
// Spawn mob packet
protocol.registerOutgoing(State.PLAY, 0x3, 0x3, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x03, 0x03, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -194,7 +194,7 @@ public class EntityPackets {
});
// Use bed
protocol.registerOutgoing(State.PLAY, 0x33, 0x3F, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x33, 0x43, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
@ -211,7 +211,7 @@ public class EntityPackets {
});
// Destroy entities
protocol.registerOutgoing(State.PLAY, 0x35, 0x35, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x35, 0x37, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT_ARRAY); // 0 - Entity IDS
@ -227,7 +227,7 @@ public class EntityPackets {
});
// Metadata packet
protocol.registerOutgoing(State.PLAY, 0x3F, 0x3F, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x3F, 0x43, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -243,6 +243,5 @@ public class EntityPackets {
});
}
});
}
}

View File

@ -42,13 +42,13 @@ public class InventoryPackets {
Short slots = wrapper.read(Type.UNSIGNED_BYTE);
if (type.equals("EntityHorse")) {
wrapper.setId(0x14);
wrapper.setId(0x1F);
int entityId = wrapper.read(Type.INT);
wrapper.write(Type.UNSIGNED_BYTE, windowsId);
wrapper.write(Type.VAR_INT, slots.intValue());
wrapper.write(Type.INT, entityId);
} else {
wrapper.setId(0x58);
wrapper.setId(0x2E);
wrapper.write(Type.VAR_INT, windowsId.intValue());
int typeId = -1;
@ -103,7 +103,7 @@ public class InventoryPackets {
});
// Window items packet
protocol.registerOutgoing(State.PLAY, 0x15, 0x15, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x15, 0x14, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // 0 - Window ID
@ -120,7 +120,7 @@ public class InventoryPackets {
});
// Set slot packet
protocol.registerOutgoing(State.PLAY, 0x17, 0x17, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x17, 0x16, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.BYTE); // 0 - Window ID
@ -137,7 +137,7 @@ public class InventoryPackets {
});
// Plugin message
protocol.registerOutgoing(State.PLAY, 0x19, 0x19, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x19, 0x18, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING); // Channel
@ -146,7 +146,7 @@ public class InventoryPackets {
public void handle(PacketWrapper wrapper) throws Exception {
String channel = wrapper.get(Type.STRING, 0);
if (channel.equals("minecraft:trader_list") || channel.equals("trader_list")) {
wrapper.setId(0x59);
wrapper.setId(0x27);
wrapper.resetReader();
wrapper.read(Type.STRING); // Remove channel
@ -181,7 +181,7 @@ public class InventoryPackets {
wrapper.read(Type.REMAINING_BYTES);
int hand = wrapper.read(Type.VAR_INT);
wrapper.clearPacket();
wrapper.setId(0x2C);
wrapper.setId(0x2D);
wrapper.write(Type.VAR_INT, hand);
}
}
@ -190,7 +190,7 @@ public class InventoryPackets {
});
// Entity Equipment Packet
protocol.registerOutgoing(State.PLAY, 0x42, 0x42, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x42, 0x46, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // 0 - Entity ID
@ -207,7 +207,7 @@ public class InventoryPackets {
});
// Declare Recipes
protocol.registerOutgoing(State.PLAY, 0x54, 0x55, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x54, 0x5A, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {

View File

@ -18,7 +18,7 @@ public class PlayerPackets {
public static void register(Protocol protocol) {
// Open Sign Editor
protocol.registerOutgoing(State.PLAY, 0x2C, 0x2E, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x2C, 0x30, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);

View File

@ -64,7 +64,7 @@ public class WorldPackets {
});
// Block Change
protocol.registerOutgoing(State.PLAY, 0xB, 0xB, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x0B, 0x0B, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
@ -95,7 +95,7 @@ public class WorldPackets {
});
// Multi Block Change
protocol.registerOutgoing(State.PLAY, 0xF, 0xF, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x0F, 0x0F, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Chunk X
@ -115,7 +115,7 @@ public class WorldPackets {
});
// Chunk
protocol.registerOutgoing(State.PLAY, 0x22, 0x22, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x22, 0x21, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@ -154,7 +154,7 @@ public class WorldPackets {
section.setNonAirBlocksCount(nonAirBlockCount);
}
PacketWrapper lightPacket = wrapper.create(0x57);
PacketWrapper lightPacket = wrapper.create(0x24);
lightPacket.write(Type.VAR_INT, chunk.getX());
lightPacket.write(Type.VAR_INT, chunk.getZ());
int skyLightMask = 0;
@ -195,7 +195,7 @@ public class WorldPackets {
EntityTracker tracker = wrapper.user().get(EntityTracker.class);
if (!tracker.isSentPosAndLook()) { // Workaround for 1.13.2 not loading chunks near to world border on join
PacketWrapper fakePosLook = wrapper.create(0x33);
PacketWrapper fakePosLook = wrapper.create(0x35);
fakePosLook.write(Type.DOUBLE, chunkBlockX);
fakePosLook.write(Type.DOUBLE, 0d); // Y
fakePosLook.write(Type.DOUBLE, chunkBlockZ);
@ -214,7 +214,7 @@ public class WorldPackets {
});
// Effect
protocol.registerOutgoing(State.PLAY, 0x23, 0x23, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x23, 0x22, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // Effect Id
@ -236,7 +236,7 @@ public class WorldPackets {
});
// Spawn Particle
protocol.registerOutgoing(State.PLAY, 0x24, 0x24, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x24, 0x23, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Particle ID
@ -344,7 +344,7 @@ public class WorldPackets {
});
// Respawn
protocol.registerOutgoing(State.PLAY, 0x38, 0x38, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x38, 0x3A, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Dimension ID
@ -370,12 +370,11 @@ public class WorldPackets {
});
// Spawn Position
protocol.registerOutgoing(State.PLAY, 0x49, 0x49, new PacketRemapper() {
protocol.registerOutgoing(State.PLAY, 0x49, 0x4D, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION, Type.POSITION1_14);
}
});
}
}

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</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>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
<packaging>pom</packaging>
<name>viaversion-parent</name>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>viaversion-parent</artifactId>
<groupId>us.myles</groupId>
<version>2.0.0-19w14a</version>
<version>2.0.0-19w14b</version>
</parent>
<modelVersion>4.0.0</modelVersion>