Skip to content

Commit

Permalink
1.20.10 (#2135)
Browse files Browse the repository at this point in the history
* 1.20.10

* Push resource files

* Non minified resources
  • Loading branch information
PetteriM1 authored Jul 12, 2023
1 parent 9f1eb25 commit 342f919
Show file tree
Hide file tree
Showing 7 changed files with 6,137 additions and 5,958 deletions.
5 changes: 5 additions & 0 deletions src/main/java/cn/nukkit/entity/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ public abstract class Entity extends Location implements Metadatable {
public static final int DATA_FLAG_SONIC_BOOM = 107;
public static final int DATA_FLAG_HAS_DASH_COOLDOWN = 108;
public static final int DATA_FLAG_PUSH_TOWARDS_CLOSEST_SPACE = 109;
public static final int DATA_FLAG_SCENTING = 110;
public static final int DATA_FLAG_RISING = 111;
public static final int DATA_FLAG_FEELING_HAPPY = 112;
public static final int DATA_FLAG_SEARCHING = 113;
public static final int DATA_FLAG_CRAWLING = 114;

public static long entityCount = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ public void encode() {
List<CommandEnum> enums = new ArrayList<>(enumsSet);
List<String> postFixes = new ArrayList<>(postFixesSet);

this.putUnsignedVarInt(enumValues.size());
enumValues.forEach(this::putString);

this.putUnsignedVarInt(postFixes.size());
postFixes.forEach(this::putString);

ObjIntConsumer<BinaryStream> indexWriter;
if (enumValues.size() < 256) {
indexWriter = WRITE_BYTE;
Expand All @@ -109,6 +103,14 @@ public void encode() {
indexWriter = WRITE_INT;
}

this.putUnsignedVarInt(enumValues.size());
enumValues.forEach(this::putString);

this.putUnsignedVarInt(0); //subCommandValues

this.putUnsignedVarInt(postFixes.size());
postFixes.forEach(this::putString);

this.putUnsignedVarInt(enums.size());
enums.forEach((cmdEnum) -> {
putString(cmdEnum.getName());
Expand All @@ -127,8 +129,9 @@ public void encode() {
}
});

putUnsignedVarInt(commands.size());
this.putUnsignedVarInt(0); //subCommandData

putUnsignedVarInt(commands.size());
commands.forEach((name, cmdData) -> {
CommandData data = cmdData.versions.get(0);

Expand All @@ -139,8 +142,11 @@ public void encode() {

putLInt(data.aliases == null ? -1 : enums.indexOf(data.aliases));

putUnsignedVarInt(0); //subcommands

putUnsignedVarInt(data.overloads.size());
for (CommandOverload overload : data.overloads.values()) {
putBoolean(false); //isChaining
putUnsignedVarInt(overload.input.parameters.length);

for (CommandParameter parameter : overload.input.parameters) {
Expand Down Expand Up @@ -170,13 +176,12 @@ public void encode() {
});

this.putUnsignedVarInt(softEnums.size());

softEnums.forEach((name, values) -> {
this.putString(name);
this.putUnsignedVarInt(values.size());
values.forEach(this::putString);
});

this.putUnsignedVarInt(0);
this.putUnsignedVarInt(0); //enumConstraints
}
}
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("589"); // DO NOT REMOVE BOXING
int CURRENT_PROTOCOL = Integer.valueOf("594"); // DO NOT REMOVE BOXING

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

String MINECRAFT_VERSION_NETWORK = "1.20.0";
String MINECRAFT_VERSION_NETWORK = "1.20.10";
String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;

byte BATCH_PACKET = (byte) 0xff;
Expand Down
Loading

0 comments on commit 342f919

Please sign in to comment.