Skip to content

Commit

Permalink
Merge pull request #56 from BoomEaro/feature/1.19.4
Browse files Browse the repository at this point in the history
Support 1.19.4
  • Loading branch information
Nan1t authored Mar 15, 2023
2 parents 593e137 + 37813a1 commit c96668f
Show file tree
Hide file tree
Showing 5 changed files with 2,783 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,12 @@ public void encode(ByteMessage msg, Version version) {
msg.writeByte(previousGameMode);
msg.writeStringsArray(worldNames);
if (version.moreOrEqual(Version.V1_19_1)) {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
if (version.moreOrEqual(Version.V1_19_4)) {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_4());
}
else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
}
}
else {
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void encode(ByteMessage msg, Version version) {
msg.writeVarInt(teleportId);
}

if (version.moreOrEqual(Version.V1_17)) {
if (version.fromTo(Version.V1_17, Version.V1_19_3)) {
msg.writeBoolean(false); // Dismount vehicle
}
}
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/ua/nanit/limbo/protocol/registry/State.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ public enum State {
map(0x32, V1_17, V1_18_2),
map(0x2F, V1_19, V1_19),
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,
map(0x08, V1_7_2, V1_8),
Expand All @@ -152,7 +153,8 @@ public enum State {
map(0x38, V1_17, V1_18_2),
map(0x36, V1_19, V1_19),
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,
map(0x00, V1_7_2, V1_8),
Expand All @@ -177,7 +179,8 @@ public enum State {
map(0x0F, V1_17, V1_18_2),
map(0x5F, V1_19, V1_19),
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,
map(0x0C, V1_9, V1_14_4),
Expand All @@ -199,7 +202,8 @@ public enum State {
map(0x36, V1_17, V1_18_2),
map(0x34, V1_19, V1_19),
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,
map(0x45, V1_8, V1_11_1),
Expand Down Expand Up @@ -249,7 +253,8 @@ public enum State {
map(0x65, V1_19_4, V1_19_4)
);
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)
);
}
};
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/ua/nanit/limbo/world/DimensionRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public final class DimensionRegistry {
private CompoundBinaryTag codec_1_18_2;
private CompoundBinaryTag codec_1_19;
private CompoundBinaryTag codec_1_19_1;
private CompoundBinaryTag codec_1_19_4;
private CompoundBinaryTag oldCodec;

public DimensionRegistry(LimboServer server) {
Expand All @@ -60,6 +61,10 @@ public CompoundBinaryTag getCodec_1_19_1() {
return codec_1_19_1;
}

public CompoundBinaryTag getCodec_1_19_4() {
return codec_1_19_4;
}

public CompoundBinaryTag getOldCodec() {
return oldCodec;
}
Expand All @@ -77,6 +82,7 @@ public void load(String def) throws IOException {
codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt");
codec_1_19 = readCodecFile("/dimension/codec_1_19.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
oldCodec = readCodecFile("/dimension/codec_old.snbt");

Expand Down
Loading

0 comments on commit c96668f

Please sign in to comment.