Skip to content
Merged

1.26.0 #2252

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/main/java/cn/nukkit/network/protocol/BookEditPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@ public byte pid() {

@Override
public void decode() {
this.action = Action.values()[this.getByte()];
this.inventorySlot = this.getByte();
this.inventorySlot = this.getVarInt();
this.action = Action.values()[(int) this.getUnsignedVarInt()];

switch (this.action) {
case REPLACE_PAGE:
case ADD_PAGE:
this.pageNumber = this.getByte();
this.pageNumber = this.getVarInt();
this.text = this.getString();
this.photoName = this.getString();
break;
case DELETE_PAGE:
this.pageNumber = this.getByte();
this.pageNumber = this.getVarInt();
break;
case SWAP_PAGES:
this.pageNumber = this.getByte();
this.secondaryPageNumber = this.getByte();
this.pageNumber = this.getVarInt();
this.secondaryPageNumber = this.getVarInt();
break;
case SIGN_BOOK:
this.title = this.getString();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/cn/nukkit/network/protocol/ProtocolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public interface ProtocolInfo {
* Actual Minecraft protocol version
*/
@SuppressWarnings("UnnecessaryBoxing")
int CURRENT_PROTOCOL = Integer.valueOf("898"); // DO NOT REMOVE BOXING
int CURRENT_PROTOCOL = Integer.valueOf("924"); // DO NOT REMOVE BOXING

List<Integer> SUPPORTED_PROTOCOLS = Ints.asList(897, CURRENT_PROTOCOL);
List<Integer> SUPPORTED_PROTOCOLS = Ints.asList(CURRENT_PROTOCOL);

String MINECRAFT_VERSION_NETWORK = "1.21.130";
String MINECRAFT_VERSION_NETWORK = "1.26.0";
String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;

byte BATCH_PACKET = (byte) 0xff;
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/cn/nukkit/network/protocol/StartGamePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ public void encode() {
this.putBoolean(false); // Experimental Gameplay
this.putByte(this.chatRestrictionLevel);
this.putBoolean(this.disablePlayerInteractions);
this.putString(""); // ServerId
this.putString(""); // WorldId
this.putString(""); // ScenarioId
this.putString(""); // OwnerId
/* Level settings end */
this.putString(this.levelId);
this.putString(this.worldName);
Expand All @@ -191,5 +187,12 @@ public void encode() {
this.putBoolean(this.clientSideGenerationEnabled);
this.putBoolean(false); // blockIdsAreHashed
this.putBoolean(true); // isServerAuthSounds
this.putBoolean(false); // no server join info
/* ServerTelemetryData start */
this.putString("");
this.putString("");
this.putString("");
this.putString("");
/* ServerTelemetryData end */
}
}
21 changes: 0 additions & 21 deletions src/main/java/cn/nukkit/network/protocol/TextPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,15 @@ public void decode() {

switch (this.getByte()) {
case 0: // MessageOnly
for (int i = 0; i < 6; i++) {
this.getString();
}
this.type = (byte) getByte();
this.message = this.getString();
break;
case 1: // AuthorAndMessage
for (int i = 0; i < 3; i++) {
this.getString();
}
this.type = (byte) getByte();
this.source = this.getString();
this.message = this.getString();
break;
case 2: // MessageAndParams
for (int i = 0; i < 3; i++) {
this.getString();
}
this.type = (byte) getByte();
this.message = this.getString();
int paramCount = (int) this.getUnsignedVarInt();
Expand Down Expand Up @@ -95,12 +86,6 @@ public void encode() {
case TYPE_OBJECT_WHISPER:
case TYPE_OBJECT_ANNOUNCEMENT:
this.putByte((byte) 0); // MessageOnly
this.putString("raw");
this.putString("tip");
this.putString("systemMessage");
this.putString("textObjectWhisper");
this.putString("textObjectAnnouncement");
this.putString("textObject");
this.putByte(this.type);
this.putString(this.message);
break;
Expand All @@ -109,9 +94,6 @@ public void encode() {
case TYPE_WHISPER:
case TYPE_ANNOUNCEMENT:
this.putByte((byte) 1); // AuthorAndMessage
this.putString("chat");
this.putString("whisper");
this.putString("announcement");
this.putByte(this.type);
this.putString(this.source);
this.putString(this.message);
Expand All @@ -121,9 +103,6 @@ public void encode() {
case TYPE_POPUP:
case TYPE_JUKEBOX_POPUP:
this.putByte((byte) 2); // MessageAndParams
this.putString("translate");
this.putString("popup");
this.putString("jukeboxPopup");
this.putByte(this.type);
this.putString(this.message);
this.putUnsignedVarInt(this.parameters.length);
Expand Down
Binary file modified src/main/resources/item_components.nbt
Binary file not shown.
Loading