aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-04 21:41:26 +0200
committernea <nea@nea.moe>2023-05-04 21:41:26 +0200
commit7053b0890f918fadd81d82259ab13db634bca02c (patch)
tree6a7ae795025ec803be43208ccf2d11f57d26e46c
parentae9d6aa3227dd9a35d87ebfbe99a949aae8bbfc2 (diff)
downloadNotEnoughUpdates-7053b0890f918fadd81d82259ab13db634bca02c.tar.gz
NotEnoughUpdates-7053b0890f918fadd81d82259ab13db634bca02c.tar.bz2
NotEnoughUpdates-7053b0890f918fadd81d82259ab13db634bca02c.zip
Allow searching armor colour
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java4
1 files changed, 4 insertions, 0 deletions
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");