Merge pull request #56 from BoomEaro/feature/1.19.4

Support 1.19.4
This commit is contained in:
Max 2023-03-15 17:31:21 +02:00 committed by GitHub
commit c96668f4d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2783 additions and 7 deletions

View File

@ -207,8 +207,13 @@ public class PacketJoinGame implements PacketOut {
msg.writeByte(previousGameMode); msg.writeByte(previousGameMode);
msg.writeStringsArray(worldNames); msg.writeStringsArray(worldNames);
if (version.moreOrEqual(Version.V1_19_1)) { if (version.moreOrEqual(Version.V1_19_1)) {
if (version.moreOrEqual(Version.V1_19_4)) {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_4());
}
else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1()); msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
} }
}
else { else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19()); msg.writeCompoundTag(dimensionRegistry.getCodec_1_19());
} }

View File

@ -59,7 +59,7 @@ public class PacketPlayerPositionAndLook implements PacketOut {
msg.writeVarInt(teleportId); msg.writeVarInt(teleportId);
} }
if (version.moreOrEqual(Version.V1_17)) { if (version.fromTo(Version.V1_17, Version.V1_19_3)) {
msg.writeBoolean(false); // Dismount vehicle msg.writeBoolean(false); // Dismount vehicle
} }
} }

View File

@ -138,7 +138,8 @@ public enum State {
map(0x32, V1_17, V1_18_2), map(0x32, V1_17, V1_18_2),
map(0x2F, V1_19, V1_19), map(0x2F, V1_19, V1_19),
map(0x31, V1_19_1, V1_19_1), map(0x31, V1_19_1, V1_19_1),
map(0x30, V1_19_3, V1_19_3) map(0x30, V1_19_3, V1_19_3),
map(0x34, V1_19_4, V1_19_4)
); );
clientBound.register(PacketPlayerPositionAndLook::new, clientBound.register(PacketPlayerPositionAndLook::new,
map(0x08, V1_7_2, V1_8), map(0x08, V1_7_2, V1_8),
@ -152,7 +153,8 @@ public enum State {
map(0x38, V1_17, V1_18_2), map(0x38, V1_17, V1_18_2),
map(0x36, V1_19, V1_19), map(0x36, V1_19, V1_19),
map(0x39, V1_19_1, V1_19_1), map(0x39, V1_19_1, V1_19_1),
map(0x38, V1_19_3, V1_19_3) map(0x38, V1_19_3, V1_19_3),
map(0x3C, V1_19_4, V1_19_4)
); );
clientBound.register(PacketKeepAlive::new, clientBound.register(PacketKeepAlive::new,
map(0x00, V1_7_2, V1_8), map(0x00, V1_7_2, V1_8),
@ -177,7 +179,8 @@ public enum State {
map(0x0F, V1_17, V1_18_2), map(0x0F, V1_17, V1_18_2),
map(0x5F, V1_19, V1_19), map(0x5F, V1_19, V1_19),
map(0x62, V1_19_1, V1_19_1), map(0x62, V1_19_1, V1_19_1),
map(0x60, V1_19_3, V1_19_3) map(0x60, V1_19_3, V1_19_3),
map(0x64, V1_19_4, V1_19_4)
); );
clientBound.register(PacketBossBar::new, clientBound.register(PacketBossBar::new,
map(0x0C, V1_9, V1_14_4), map(0x0C, V1_9, V1_14_4),
@ -199,7 +202,8 @@ public enum State {
map(0x36, V1_17, V1_18_2), map(0x36, V1_17, V1_18_2),
map(0x34, V1_19, V1_19), map(0x34, V1_19, V1_19),
map(0x37, V1_19_1, V1_19_1), map(0x37, V1_19_1, V1_19_1),
map(0x36, V1_19_3, V1_19_3) map(0x36, V1_19_3, V1_19_3),
map(0x3A, V1_19_4, V1_19_4)
); );
clientBound.register(PacketTitleLegacy::new, clientBound.register(PacketTitleLegacy::new,
map(0x45, V1_8, V1_11_1), map(0x45, V1_8, V1_11_1),
@ -249,7 +253,8 @@ public enum State {
map(0x65, V1_19_4, V1_19_4) map(0x65, V1_19_4, V1_19_4)
); );
clientBound.register(PacketSpawnPosition::new, clientBound.register(PacketSpawnPosition::new,
map(0x4C, V1_19_3, V1_19_3) map(0x4C, V1_19_3, V1_19_3),
map(0x50, V1_19_4, V1_19_4)
); );
} }
}; };

View File

@ -38,6 +38,7 @@ public final class DimensionRegistry {
private CompoundBinaryTag codec_1_18_2; private CompoundBinaryTag codec_1_18_2;
private CompoundBinaryTag codec_1_19; private CompoundBinaryTag codec_1_19;
private CompoundBinaryTag codec_1_19_1; private CompoundBinaryTag codec_1_19_1;
private CompoundBinaryTag codec_1_19_4;
private CompoundBinaryTag oldCodec; private CompoundBinaryTag oldCodec;
public DimensionRegistry(LimboServer server) { public DimensionRegistry(LimboServer server) {
@ -60,6 +61,10 @@ public final class DimensionRegistry {
return codec_1_19_1; return codec_1_19_1;
} }
public CompoundBinaryTag getCodec_1_19_4() {
return codec_1_19_4;
}
public CompoundBinaryTag getOldCodec() { public CompoundBinaryTag getOldCodec() {
return oldCodec; return oldCodec;
} }
@ -77,6 +82,7 @@ public final class DimensionRegistry {
codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt"); codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt");
codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt"); codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt");
codec_1_19_1 = readCodecFile("/dimension/codec_1_19_1.snbt"); codec_1_19_1 = readCodecFile("/dimension/codec_1_19_1.snbt");
codec_1_19_4 = readCodecFile("/dimension/codec_1_19_4.snbt");
// On 1.16-1.16.1 different codec format // On 1.16-1.16.1 different codec format
oldCodec = readCodecFile("/dimension/codec_old.snbt"); oldCodec = readCodecFile("/dimension/codec_old.snbt");

File diff suppressed because it is too large Load Diff