Fix Light & window click test

This commit is contained in:
TheMode 2021-06-11 15:38:46 +02:00
parent 88052576b3
commit 97d17f9b8b
2 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ public class ClientClickWindowPacket extends ClientPlayPacket {
public byte windowId;
public short slot;
public byte button;
public ClickType clickType;
public ClickType clickType = ClickType.PICKUP;
public Short2ObjectMap<ItemStack> changedSlots = new Short2ObjectOpenHashMap<>();
public ItemStack item = ItemStack.AIR;

View File

@ -90,19 +90,20 @@ public class UpdateLightPacket implements ServerPacket, CacheablePacket {
// sky light
skyLight.clear();
for (int i = 0; i < 14; i++) {
final int skyLightCount = reader.readVarInt();
for (int i = 0; i < skyLightCount; i++) {
int length = reader.readVarInt();
if (length != 2048) {
throw new IllegalStateException("Length must be 2048.");
}
byte[] bytes = reader.readBytes(length);
skyLight.add(bytes);
}
// block light
blockLight.clear();
for (int i = 0; i < 6; i++) {
final int blockLightCount = reader.readVarInt();
for (int i = 0; i < blockLightCount; i++) {
int length = reader.readVarInt();
if (length != 2048) {
throw new IllegalStateException("Length must be 2048.");