Skip to content

Commit e7906b4

Browse files
authored
1.21.30
1 parent 95a67b9 commit e7906b4

20 files changed

+70
-51
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v4
1515
with:
1616
submodules: true
1717
- name: SetupJDK
18-
uses: actions/setup-java@v3
18+
uses: actions/setup-java@v4
1919
with:
2020
java-version: 8
2121
distribution: 'temurin'
2222
- name: Validate Gradle Wrapper
23-
uses: gradle/wrapper-validation-action@v1
23+
uses: gradle/wrapper-validation-action@v3
2424
- name: Build
25-
uses: gradle/gradle-build-action@v2
25+
uses: gradle/gradle-build-action@v3
2626
with:
2727
gradle-version: wrapper
2828
arguments: "publishNukkitPublicationToOpencollabRepository"

.github/workflows/pull-request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ jobs:
88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v1
11+
- uses: actions/checkout@v4
1212
with:
1313
submodules: true
1414
- name: SetupJDK
15-
uses: actions/setup-java@v3
15+
uses: actions/setup-java@v4
1616
with:
1717
java-version: 8
1818
distribution: 'temurin'
1919
- name: Validate Gradle Wrapper
20-
uses: gradle/wrapper-validation-action@v1
20+
uses: gradle/wrapper-validation-action@v3
2121
- name: Build
22-
uses: gradle/gradle-build-action@v2
22+
uses: gradle/gradle-build-action@v3
2323
with:
2424
gradle-version: wrapper
2525
arguments: "shadowJar"
2626
env:
2727
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.caching=true -Dorg.gradle.welcome=never"
2828
- name: Archive artifacts
29-
uses: actions/upload-artifact@v1
29+
uses: actions/upload-artifact@v4
3030
if: success()
3131
with:
3232
name: Nukkit

src/main/java/cn/nukkit/command/defaults/EffectCommand.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ public boolean execute(CommandSender sender, String commandLabel, String[] args)
7171
try {
7272
effect = Effect.getEffect(Integer.parseInt(args[1]));
7373
} catch (NumberFormatException | ServerException a) {
74-
try {
75-
effect = Effect.getEffectByName(args[1]);
76-
} catch (Exception e) {
77-
sender.sendMessage(new TranslationContainer("commands.effect.notFound", args[1]));
78-
return true;
79-
}
74+
effect = Effect.getEffectByName(args[1]);
75+
}
76+
if (effect == null) {
77+
sender.sendMessage(new TranslationContainer("commands.effect.notFound", args[1]));
78+
return true;
8079
}
8180
int duration = 300;
8281
int amplification = 0;

src/main/java/cn/nukkit/entity/Entity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ protected DataPacket createAddEntityPacket() {
10901090

10911091
addEntity.links = new EntityLink[this.passengers.size()];
10921092
for (int i = 0; i < addEntity.links.length; i++) {
1093-
addEntity.links[i] = new EntityLink(this.getId(), this.passengers.get(i).getId(), i == 0 ? EntityLink.TYPE_RIDER : TYPE_PASSENGER, false, false);
1093+
addEntity.links[i] = new EntityLink(this.getId(), this.passengers.get(i).getId(), i == 0 ? EntityLink.TYPE_RIDER : TYPE_PASSENGER, false, false, 0f);
10941094
}
10951095

10961096
return addEntity;

src/main/java/cn/nukkit/network/Network.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class Network {
4747
public static final byte CHANNEL_TEXT = 7; //Chat and other text stuff
4848
public static final byte CHANNEL_END = 31;
4949

50-
private Class<? extends DataPacket>[] packetPool = new Class[512];
50+
private Class<? extends DataPacket>[] packetPool = new Class[256];
5151

5252
private final Server server;
5353

@@ -245,8 +245,8 @@ public void processBatch(byte[] payload, Collection<DataPacket> packets, Compres
245245
// | 2 bits | 2 bits | 10 bits |
246246
int packetId = header & 0x3ff;
247247

248-
DataPacket pk = this.getPacket(packetId);
249-
248+
// Use internal backwards compatible IDs until pid() is rewritten
249+
DataPacket pk = this.getPacket(packetId >= 300 ? packetId - 100 : packetId);
250250
if (pk != null) {
251251
pk.setBuffer(buf, buf.length - bais.available());
252252
try {
@@ -261,7 +261,7 @@ public void processBatch(byte[] payload, Collection<DataPacket> packets, Compres
261261

262262
packets.add(pk);
263263
} else {
264-
log.debug("Received unknown packet with ID: {}", Integer.toHexString(packetId));
264+
log.debug("Received unknown packet with vanilla ID 0x{}", Integer.toHexString(packetId));
265265
}
266266
}
267267
} catch (Exception e) {
@@ -308,7 +308,7 @@ public void unblockAddress(InetAddress address) {
308308
}
309309

310310
private void registerPackets() {
311-
this.packetPool = new Class[512];
311+
this.packetPool = new Class[256];
312312

313313
this.registerPacket(ProtocolInfo.ADD_ENTITY_PACKET, AddEntityPacket.class);
314314
this.registerPacket(ProtocolInfo.ADD_ITEM_ENTITY_PACKET, AddItemEntityPacket.class);

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ public class AddEntityPacket extends DataPacket {
139139
.put(EntityTadpole.NETWORK_ID, "minecraft:tadpole")
140140
.put(EntityAllay.NETWORK_ID, "minecraft:allay")
141141
.put(138, "minecraft:camel")
142+
.put(139, "minecraft:sniffer")
143+
.put(140, "minecraft:breeze")
144+
.put(141, "minecraft:breeze_wind_charge_projectile")
145+
.put(142, "minecraft:armadillo")
146+
.put(143, "minecraft:wind_charge_projectile")
147+
.put(144, "minecraft:bogged")
142148
.build();
143149

144150
@Override

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class EmotePacket extends DataPacket {
1010
public String platformId;
1111
public String emoteID;
1212
public byte flags;
13+
public long emoteTicks;
1314

1415
@Override
1516
public byte pid() {
@@ -20,6 +21,7 @@ public byte pid() {
2021
public void decode() {
2122
this.runtimeId = this.getEntityRuntimeId();
2223
this.emoteID = this.getString();
24+
this.emoteTicks = this.getUnsignedVarInt();
2325
this.xuid = this.getString();
2426
this.platformId = this.getString();
2527
this.flags = (byte) this.getByte();
@@ -30,6 +32,7 @@ public void encode() {
3032
this.reset();
3133
this.putEntityRuntimeId(this.runtimeId);
3234
this.putString(this.emoteID);
35+
this.putUnsignedVarInt(this.emoteTicks);
3336
this.putString(this.xuid);
3437
this.putString(this.platformId);
3538
this.putByte(flags);

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public byte pid() {
2525

2626
public int inventoryId;
2727
public Item[] slots = new Item[0];
28-
public int dynamicContainerId;
2928

3029
@Override
3130
public DataPacket clean() {
@@ -46,7 +45,9 @@ public void encode() {
4645
for (Item slot : this.slots) {
4746
this.putSlot(slot);
4847
}
49-
this.putUnsignedVarInt(this.dynamicContainerId);
48+
this.putByte((byte) 0); // fullContainerName.id
49+
this.putBoolean(false); // fullContainerName.optional.present
50+
this.putUnsignedVarInt(0); // dynamicContainerSize
5051
}
5152

5253
@Override

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public byte pid() {
2020
public int inventoryId;
2121
public int slot;
2222
public Item item;
23-
public int dynamicContainerId;
2423

2524
@Override
2625
public void decode() {
@@ -31,7 +30,9 @@ public void encode() {
3130
this.reset();
3231
this.putUnsignedVarInt(this.inventoryId);
3332
this.putUnsignedVarInt(this.slot);
34-
this.putUnsignedVarInt(this.dynamicContainerId);
33+
this.putByte((byte) 0); // fullContainerName.id
34+
this.putBoolean(false); // fullContainerName.optional.present
35+
this.putUnsignedVarInt(0); // dynamicContainerSize
3536
this.putSlot(this.item);
3637
}
3738
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public interface ProtocolInfo {
1414
* Actual Minecraft: PE protocol version
1515
*/
1616
@SuppressWarnings("UnnecessaryBoxing")
17-
int CURRENT_PROTOCOL = Integer.valueOf("712"); // DO NOT REMOVE BOXING
17+
int CURRENT_PROTOCOL = Integer.valueOf("729"); // DO NOT REMOVE BOXING
1818

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

21-
String MINECRAFT_VERSION_NETWORK = "1.21.20";
21+
String MINECRAFT_VERSION_NETWORK = "1.21.30";
2222
String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;
2323

2424
byte BATCH_PACKET = (byte) 0xff;
@@ -235,4 +235,6 @@ public interface ProtocolInfo {
235235
byte __INTERNAL__JIGSAW_STRUCTURE_DATA_PACKET = (byte) 213;
236236
byte __INTERNAL__CURRENT_STRUCTURE_FEATURE_PACKET = (byte) 214;
237237
byte __INTERNAL__SERVERBOUND_DIAGNOSTICS_PACKET = (byte) 215;
238+
byte __INTERNAL__CAMERA_AIM_ASSIST_PACKET = (byte) 216;
239+
byte __INTERNAL__CONTAINER_REGISTRY_CLEANUP_PACKET = (byte) 217;
238240
}

0 commit comments

Comments
 (0)