Skip to content

Commit 7a2b152

Browse files
committed
fix: v1_21_70_24
1 parent e61c722 commit 7a2b152

File tree

10 files changed

+14
-13
lines changed

10 files changed

+14
-13
lines changed

src/main/java/cn/nukkit/form/window/FormWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public String getJSONData() {
2626

2727
public String getJSONData(int protocol) {
2828
if (this instanceof FormWindowSimple) {
29-
if (protocol >= ProtocolInfo.v1_21_70_25) {
29+
if (protocol >= ProtocolInfo.v1_21_70_24) {
3030
return GSON_FORM_WINDOW_SIMPLE_785.toJson(this);
3131
}
3232
return GSON_FORM_WINDOW_SIMPLE.toJson(this);

src/main/java/cn/nukkit/form/window/FormWindowCustom.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void setResponse(int protocol, String data) {
9797
if (e instanceof ElementLabel) {
9898
labelResponses.put(i, ((ElementLabel) e).getText());
9999
responses.put(i, ((ElementLabel) e).getText());
100-
if (protocol < ProtocolInfo.v1_21_70_25) {
100+
if (protocol < ProtocolInfo.v1_21_70_24) {
101101
// to be compatible with the older response before 1.21.70
102102
responseIndex++;
103103
}

src/main/java/cn/nukkit/item/Item.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ public static CreativeItems getCreativeItemsAndGroups(int protocol) {
830830
return Item.creative766;
831831
case v1_21_60:
832832
return Item.creative776;
833+
case v1_21_70_24:
833834
case v1_21_70:
834835
return Item.creative786;
835836
// TODO Multiversion

src/main/java/cn/nukkit/item/RuntimeItems.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static void init() {
154154
}
155155

156156
public static RuntimeItemMapping getMapping(int protocolId) {
157-
if (protocolId >= ProtocolInfo.v1_21_70) {
157+
if (protocolId >= ProtocolInfo.v1_21_70_24) {
158158
return mapping786;
159159
} else if (protocolId >= ProtocolInfo.v1_21_60) {
160160
return mapping776;

src/main/java/cn/nukkit/level/GlobalBlockPalette.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public static void init() {
298298
}
299299

300300
public static BlockPalette getPaletteByProtocol(int protocol) {
301-
if (protocol >= ProtocolInfo.v1_21_70) {
301+
if (protocol >= ProtocolInfo.v1_21_70_24) {
302302
if (blockPalette786 == null) {
303303
blockPalette786 = new BlockPalette(ProtocolInfo.v1_21_70);
304304
}

src/main/java/cn/nukkit/level/Level.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5084,7 +5084,7 @@ private LongSet getChunkSendTasks(int protocol) {
50845084
}
50855085

50865086
private int getChunkProtocol(int protocol) {
5087-
if (protocol >= ProtocolInfo.v1_21_70) {
5087+
if (protocol >= ProtocolInfo.v1_21_70_24) {
50885088
return ProtocolInfo.v1_21_70;
50895089
} else if (protocol >= ProtocolInfo.v1_21_60) {
50905090
return ProtocolInfo.v1_21_60;
@@ -5212,7 +5212,7 @@ private static boolean matchMVChunkProtocol(int chunk, int player) {
52125212
if (chunk == ProtocolInfo.v1_21_40) if (player < ProtocolInfo.v1_21_50_26) return true;
52135213
if (chunk == ProtocolInfo.v1_21_50) if (player < ProtocolInfo.v1_21_60) return true;
52145214
if (chunk == ProtocolInfo.v1_21_60) if (player < ProtocolInfo.v1_21_70) return true;
5215-
if (chunk == ProtocolInfo.v1_21_70) if (player >= ProtocolInfo.v1_21_70) return true;
5215+
if (chunk == ProtocolInfo.v1_21_70) if (player >= ProtocolInfo.v1_21_70_24) return true;
52165216
return false; //TODO Multiversion Remember to update when block palette changes
52175217
}
52185218

src/main/java/cn/nukkit/network/protocol/LevelSoundEventPacket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ public void decode() {
647647
this.entityIdentifier = this.getString();
648648
this.isBabyMob = this.getBoolean();
649649
this.isGlobal = this.getBoolean();
650-
if (this.protocol >= ProtocolInfo.v1_21_70) {
650+
if (this.protocol >= ProtocolInfo.v1_21_70_24) {
651651
this.entityUniqueId = this.getLLong();
652652
}
653653
}
@@ -661,7 +661,7 @@ public void encode() {
661661
this.putString(this.entityIdentifier);
662662
this.putBoolean(this.isBabyMob);
663663
this.putBoolean(this.isGlobal);
664-
if (this.protocol >= ProtocolInfo.v1_21_70) {
664+
if (this.protocol >= ProtocolInfo.v1_21_70_24) {
665665
this.putLLong(this.entityUniqueId);
666666
}
667667
}

src/main/java/cn/nukkit/network/protocol/ProtocolInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public interface ProtocolInfo {
9292
int v1_21_50_26 = 765;
9393
int v1_21_50 = 766;
9494
int v1_21_60 = 776;
95-
int v1_21_70_25 = 785; //TODO
95+
int v1_21_70_24 = 785; //TODO
9696
int v1_21_70 = 786;
9797

9898
int CURRENT_PROTOCOL = Utils.dynamic(v1_21_70);
@@ -104,7 +104,7 @@ public interface ProtocolInfo {
104104
v1_16_230_54, v1_17_0, v1_17_10, v1_17_20_20, v1_17_30, v1_17_40, v1_18_0, v1_18_10, v1_18_30, v1_19_0_29, v1_19_0_31, v1_19_0,
105105
v1_19_10, v1_19_20, v1_19_21, v1_19_30_23, v1_19_30, v1_19_40, v1_19_50_20, v1_19_50, v1_19_60, v1_19_63, v1_19_70_24, v1_19_70,
106106
v1_19_80, v1_20_0_23, v1_20_0, v1_20_10_21, v1_20_10, v1_20_30_24, v1_20_30, v1_20_40, v1_20_50, v1_20_60, v1_20_70, v1_20_80,
107-
v1_21_0, v1_21_2, v1_21_20, v1_21_30, v1_21_40, v1_21_50_26, v1_21_50, v1_21_60, v1_21_70
107+
v1_21_0, v1_21_2, v1_21_20, v1_21_30, v1_21_40, v1_21_50_26, v1_21_50, v1_21_60, v1_21_70_24, v1_21_70
108108
);
109109

110110
String MINECRAFT_VERSION_NETWORK = Utils.getVersionByProtocol(CURRENT_PROTOCOL);

src/main/java/cn/nukkit/network/protocol/SetHudPacket.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public byte pid() {
3535
@Override
3636
public void decode() {
3737
this.elements.clear();
38-
if (this.protocol >= ProtocolInfo.v1_21_70) {
38+
if (this.protocol >= ProtocolInfo.v1_21_70_24) {
3939
this.getArray(this.elements, value -> HudElement.values()[(int) this.getVarInt()]);
4040
this.visibility = HudVisibility.values()[this.getInt()];
4141
} else {
@@ -47,7 +47,7 @@ public void decode() {
4747
@Override
4848
public void encode() {
4949
this.reset();
50-
if (this.protocol >= ProtocolInfo.v1_21_70) {
50+
if (this.protocol >= ProtocolInfo.v1_21_70_24) {
5151
this.putArray(this.elements, (buf, element) -> this.putVarInt(element.ordinal()));
5252
this.putInt(this.visibility.ordinal());
5353
} else {

src/main/java/cn/nukkit/utils/Utils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public static String getVersionByProtocol(int protocol) {
504504
case ProtocolInfo.v1_21_40 -> "1.21.40";
505505
case ProtocolInfo.v1_21_50_26, ProtocolInfo.v1_21_50 -> "1.21.50";
506506
case ProtocolInfo.v1_21_60 -> "1.21.60";
507-
case ProtocolInfo.v1_21_70 -> "1.21.70";
507+
case ProtocolInfo.v1_21_70_24, ProtocolInfo.v1_21_70 -> "1.21.70";
508508
//TODO Multiversion 添加新版本支持时修改这里
509509
default -> throw new IllegalStateException("Invalid protocol: " + protocol);
510510
};

0 commit comments

Comments
 (0)