From 7ec9eb08d97035cf80dcba81318a0ad48a64dc8b Mon Sep 17 00:00:00 2001 From: KennyTV Date: Mon, 22 Jun 2020 10:20:00 +0200 Subject: [PATCH] Fix banner item color in 1.12->1.13 Fixes #1809 --- .../protocol1_13to1_12_2/packets/InventoryPackets.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java index edd520f5e..93bef93f3 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/InventoryPackets.java @@ -274,12 +274,18 @@ public class InventoryPackets { // NBT Changes if (tag != null) { - // Invert shield color id - if (item.getIdentifier() == 442 || item.getIdentifier() == 425) { + // Invert banner/shield color id + boolean banner = item.getIdentifier() == 425; + if (banner || item.getIdentifier() == 442) { if (tag.get("BlockEntityTag") instanceof CompoundTag) { CompoundTag blockEntityTag = tag.get("BlockEntityTag"); if (blockEntityTag.get("Base") instanceof IntTag) { IntTag base = blockEntityTag.get("Base"); + // Set banner item id according to nbt + if (banner) { + rawId = 6800 + base.getValue(); + } + base.setValue(15 - base.getValue()); } if (blockEntityTag.get("Patterns") instanceof ListTag) {