Skip to content

Commit

Permalink
Add 1.20.80 support (#2176)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetteriM1 authored Apr 23, 2024
1 parent 14e4a77 commit 86683f2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void encode() {
this.putUUID(shaped.getId());
this.putString(CRAFTING_TAG_CRAFTING_TABLE);
this.putVarInt(shaped.getPriority());
this.putBoolean(true); // Assume symmetry
this.putUnsignedVarInt(recipeNetworkId++);
break;
case FURNACE:
Expand Down
4 changes: 2 additions & 2 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: PE protocol version
*/
@SuppressWarnings("UnnecessaryBoxing")
int CURRENT_PROTOCOL = Integer.valueOf("662"); // DO NOT REMOVE BOXING
int CURRENT_PROTOCOL = Integer.valueOf("671"); // DO NOT REMOVE BOXING

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

String MINECRAFT_VERSION_NETWORK = "1.20.70";
String MINECRAFT_VERSION_NETWORK = "1.20.80";
String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;

byte BATCH_PACKET = (byte) 0xff;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void encode() {
this.putString(this.gameVersion);
this.putLInt(0); // Experiments length
this.putBoolean(false); // Were experiments previously toggled
this.putBoolean(false); // Has editor packs
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/cn/nukkit/network/protocol/StartGamePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public byte pid() {
public byte chatRestrictionLevel;
public boolean disablePlayerInteractions;
public boolean emoteChatMuted;
public boolean hardcore;

@Override
public void decode() {
Expand All @@ -110,6 +111,7 @@ public void encode() {
this.putVarInt(this.dimension);
this.putVarInt(this.generator);
this.putVarInt(this.worldGamemode);
this.putBoolean(this.hardcore);
this.putVarInt(this.difficulty);
this.putBlockVector3(this.spawnX, this.spawnY, this.spawnZ);
this.putBoolean(this.hasAchievementsDisabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class UpdatePlayerGameTypePacket extends DataPacket {

public GameType gameType;
public long entityId;
public int tick;

@Override
public byte pid() {
Expand All @@ -24,7 +25,8 @@ public void decode() {
public void encode() {
this.reset();
this.putVarInt(this.gameType.ordinal());
this.putVarLong(entityId);
this.putVarLong(this.entityId);
this.putUnsignedVarInt(this.tick);
}

public enum GameType {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/creative_items.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/main/resources/item_mappings.json

Large diffs are not rendered by default.

Binary file modified src/main/resources/runtime_block_states.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/resources/runtime_item_states.json

Large diffs are not rendered by default.

0 comments on commit 86683f2

Please sign in to comment.