add support 21w17a

This commit is contained in:
Bixilon 2021-04-29 00:20:58 +02:00
parent 134ec6207c
commit 2497b9500b
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
5 changed files with 16 additions and 10 deletions

View File

@ -22,20 +22,25 @@ import de.bixilon.minosoft.util.logging.Log;
import java.util.Arrays; import java.util.Arrays;
import static de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_14W04A; import static de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_14W04A;
import static de.bixilon.minosoft.protocol.protocol.ProtocolVersions.V_21W17A;
public class PacketDestroyEntity extends PlayS2CPacket { public class PacketDestroyEntity extends PlayS2CPacket {
private final int[] entityIds; private final int[] entityIds;
public PacketDestroyEntity(PlayInByteBuffer buffer) { public PacketDestroyEntity(PlayInByteBuffer buffer) {
if (buffer.getVersionId() < V_14W04A) { if (buffer.getVersionId() < V_21W17A) {
this.entityIds = new int[buffer.readByte()]; if (buffer.getVersionId() < V_14W04A) {
} else { this.entityIds = new int[buffer.readByte()];
this.entityIds = new int[buffer.readVarInt()]; } else {
} this.entityIds = new int[buffer.readVarInt()];
}
for (int i = 0; i < this.entityIds.length; i++) { for (int i = 0; i < this.entityIds.length; i++) {
this.entityIds[i] = buffer.readEntityId(); this.entityIds[i] = buffer.readEntityId();
}
return;
} }
this.entityIds = new int[]{buffer.readVarInt()};
} }
@Override @Override

View File

@ -16,6 +16,7 @@ package de.bixilon.minosoft.protocol.protocol;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class ProtocolVersions { public class ProtocolVersions {
public static final int public static final int
V_21W17A = 777,
V_21W16A = 776, V_21W16A = 776,
V_21W15A = 775, V_21W15A = 775,
V_21W14A = 774, V_21W14A = 774,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long