From 7053b0890f918fadd81d82259ab13db634bca02c Mon Sep 17 00:00:00 2001 From: nea Date: Thu, 4 May 2023 21:41:26 +0200 Subject: Allow searching armor colour --- src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 0281d95b..ffffa064 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -47,6 +47,7 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.JsonToNBT; @@ -550,6 +551,9 @@ public class NEUManager { result = result || multiSearchString(stack.getDisplayName(), query); String lore = ""; + if (stack.getItem() instanceof ItemArmor && ((ItemArmor)stack.getItem()).getArmorMaterial() == ItemArmor.ArmorMaterial.LEATHER) { + lore = String.format("#%06x",((ItemArmor)stack.getItem()).getColor(stack)); + } NBTTagCompound tag = stack.getTagCompound(); if (tag != null) { NBTTagCompound display = tag.getCompoundTag("display"); -- cgit