From c1cd8bc03ec5f8afaca68eaf11223523da252dcd Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Sun, 6 Aug 2023 03:08:52 +0200 Subject: [PATCH 1/2] Allow skylight to be set to null (#3396) --- .../api/minecraft/chunks/ChunkSectionLightImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/src/main/java/com/viaversion/viaversion/api/minecraft/chunks/ChunkSectionLightImpl.java b/api/src/main/java/com/viaversion/viaversion/api/minecraft/chunks/ChunkSectionLightImpl.java index cf049a110..9f64d89c9 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/minecraft/chunks/ChunkSectionLightImpl.java +++ b/api/src/main/java/com/viaversion/viaversion/api/minecraft/chunks/ChunkSectionLightImpl.java @@ -47,6 +47,11 @@ public class ChunkSectionLightImpl implements ChunkSectionLight { @Override public void setSkyLight(byte[] data) { + if (data == null) { + this.skyLight = null; + return; + } + if (data.length != LIGHT_LENGTH) throw new IllegalArgumentException("Data length != " + LIGHT_LENGTH); if (this.skyLight == null) { this.skyLight = new NibbleArray(data); From 2b9e0cec5ce9567bca6cbcce04c40445062f9df2 Mon Sep 17 00:00:00 2001 From: RK_01 <50594595+RaphiMC@users.noreply.github.com> Date: Sun, 6 Aug 2023 03:11:42 +0200 Subject: [PATCH 2/2] Fix maps with no map id set showing up as empty on 1.17+ (#3395) --- .../packets/InventoryPackets.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java index 603c6cd21..70d225290 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_17to1_16_4/packets/InventoryPackets.java @@ -17,6 +17,9 @@ */ package com.viaversion.viaversion.protocols.protocol1_17to1_16_4.packets; +import com.github.steveice10.opennbt.tag.builtin.CompoundTag; +import com.github.steveice10.opennbt.tag.builtin.IntTag; +import com.github.steveice10.opennbt.tag.builtin.NumberTag; import com.viaversion.viaversion.api.minecraft.item.Item; import com.viaversion.viaversion.api.protocol.packet.PacketWrapper; import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers; @@ -122,4 +125,23 @@ public final class InventoryPackets extends ItemRewriter