mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 00:47:39 +01:00
Merge remote-tracking branch 'origin/master' into dev
This commit is contained in:
commit
573cdfb3ac
@ -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);
|
||||
|
@ -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<ClientboundPackets1_16_
|
||||
wrapper.cancel();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item handleItemToClient(Item item) {
|
||||
if (item == null) return null;
|
||||
|
||||
CompoundTag tag = item.tag();
|
||||
if (item.identifier() == 733) {
|
||||
if (tag == null) {
|
||||
item.setTag(tag = new CompoundTag());
|
||||
}
|
||||
if (!(tag.get("map") instanceof NumberTag)) {
|
||||
tag.put("map", new IntTag(0));
|
||||
}
|
||||
}
|
||||
|
||||
item.setIdentifier(this.protocol.getMappingData().getNewItemId(item.identifier()));
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user