Skip to content

Commit c96668f

Browse files
authored
Merge pull request #56 from BoomEaro/feature/1.19.4
Support 1.19.4
2 parents 593e137 + 37813a1 commit c96668f

File tree

5 files changed

+2783
-7
lines changed

5 files changed

+2783
-7
lines changed

src/main/java/ua/nanit/limbo/protocol/packets/play/PacketJoinGame.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,12 @@ public void encode(ByteMessage msg, Version version) {
207207
msg.writeByte(previousGameMode);
208208
msg.writeStringsArray(worldNames);
209209
if (version.moreOrEqual(Version.V1_19_1)) {
210-
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
210+
if (version.moreOrEqual(Version.V1_19_4)) {
211+
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_4());
212+
}
213+
else {
214+
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19_1());
215+
}
211216
}
212217
else {
213218
msg.writeCompoundTag(dimensionRegistry.getCodec_1_19());

src/main/java/ua/nanit/limbo/protocol/packets/play/PacketPlayerPositionAndLook.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void encode(ByteMessage msg, Version version) {
5959
msg.writeVarInt(teleportId);
6060
}
6161

62-
if (version.moreOrEqual(Version.V1_17)) {
62+
if (version.fromTo(Version.V1_17, Version.V1_19_3)) {
6363
msg.writeBoolean(false); // Dismount vehicle
6464
}
6565
}

src/main/java/ua/nanit/limbo/protocol/registry/State.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public enum State {
138138
map(0x32, V1_17, V1_18_2),
139139
map(0x2F, V1_19, V1_19),
140140
map(0x31, V1_19_1, V1_19_1),
141-
map(0x30, V1_19_3, V1_19_3)
141+
map(0x30, V1_19_3, V1_19_3),
142+
map(0x34, V1_19_4, V1_19_4)
142143
);
143144
clientBound.register(PacketPlayerPositionAndLook::new,
144145
map(0x08, V1_7_2, V1_8),
@@ -152,7 +153,8 @@ public enum State {
152153
map(0x38, V1_17, V1_18_2),
153154
map(0x36, V1_19, V1_19),
154155
map(0x39, V1_19_1, V1_19_1),
155-
map(0x38, V1_19_3, V1_19_3)
156+
map(0x38, V1_19_3, V1_19_3),
157+
map(0x3C, V1_19_4, V1_19_4)
156158
);
157159
clientBound.register(PacketKeepAlive::new,
158160
map(0x00, V1_7_2, V1_8),
@@ -177,7 +179,8 @@ public enum State {
177179
map(0x0F, V1_17, V1_18_2),
178180
map(0x5F, V1_19, V1_19),
179181
map(0x62, V1_19_1, V1_19_1),
180-
map(0x60, V1_19_3, V1_19_3)
182+
map(0x60, V1_19_3, V1_19_3),
183+
map(0x64, V1_19_4, V1_19_4)
181184
);
182185
clientBound.register(PacketBossBar::new,
183186
map(0x0C, V1_9, V1_14_4),
@@ -199,7 +202,8 @@ public enum State {
199202
map(0x36, V1_17, V1_18_2),
200203
map(0x34, V1_19, V1_19),
201204
map(0x37, V1_19_1, V1_19_1),
202-
map(0x36, V1_19_3, V1_19_3)
205+
map(0x36, V1_19_3, V1_19_3),
206+
map(0x3A, V1_19_4, V1_19_4)
203207
);
204208
clientBound.register(PacketTitleLegacy::new,
205209
map(0x45, V1_8, V1_11_1),
@@ -249,7 +253,8 @@ public enum State {
249253
map(0x65, V1_19_4, V1_19_4)
250254
);
251255
clientBound.register(PacketSpawnPosition::new,
252-
map(0x4C, V1_19_3, V1_19_3)
256+
map(0x4C, V1_19_3, V1_19_3),
257+
map(0x50, V1_19_4, V1_19_4)
253258
);
254259
}
255260
};

src/main/java/ua/nanit/limbo/world/DimensionRegistry.java

+6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public final class DimensionRegistry {
3838
private CompoundBinaryTag codec_1_18_2;
3939
private CompoundBinaryTag codec_1_19;
4040
private CompoundBinaryTag codec_1_19_1;
41+
private CompoundBinaryTag codec_1_19_4;
4142
private CompoundBinaryTag oldCodec;
4243

4344
public DimensionRegistry(LimboServer server) {
@@ -60,6 +61,10 @@ public CompoundBinaryTag getCodec_1_19_1() {
6061
return codec_1_19_1;
6162
}
6263

64+
public CompoundBinaryTag getCodec_1_19_4() {
65+
return codec_1_19_4;
66+
}
67+
6368
public CompoundBinaryTag getOldCodec() {
6469
return oldCodec;
6570
}
@@ -77,6 +82,7 @@ public void load(String def) throws IOException {
7782
codec_1_18_2 = readCodecFile("/dimension/codec_1_18_2.snbt");
7883
codec_1_19 = readCodecFile("/dimension/codec_1_19.snbt");
7984
codec_1_19_1 = readCodecFile("/dimension/codec_1_19_1.snbt");
85+
codec_1_19_4 = readCodecFile("/dimension/codec_1_19_4.snbt");
8086
// On 1.16-1.16.1 different codec format
8187
oldCodec = readCodecFile("/dimension/codec_old.snbt");
8288

0 commit comments

Comments
 (0)