Paper/patches/server/1037-Expose-hasColor-to-leather-armor.patch
Nassim Jahnke 6e71f41536
Updated Upstream (CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
65247583f SPIGOT-7857: Improve ItemMeta block data deserialization
05d80500d SPIGOT-7857: Fix spurious internal NBT tag when deserializing BlockStateMeta
cebb58e9a SPIGOT-7804: Fix written book serialization
efcdd5d38 SPIGOT-7794: Cancelling InventoryItemMoveEvent destroys items
b568ba572 SPIGOT-7789: Fix NPE in CraftMetaFirework applyToItem
f057cf449 Remove outdated build delay

Spigot Changes:
f6a48054 SPIGOT-7835: Fix issue with custom hopper settings
bb63b137 Rebuild patches
e1142b4d Rebuild patches
2024-08-24 11:23:57 +02:00

39 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: SoSeDiK <mrsosedik@gmail.com>
Date: Wed, 1 May 2024 10:58:50 +0300
Subject: [PATCH] Expose #hasColor to leather armor
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
index 4e423c4790d7b03c283c9a5fa94bce4a1153445e..1e8a76f6dd54931eec261653a7bd51b6d18d3c68 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
@@ -134,4 +134,11 @@ public class CraftMetaColorableArmor extends CraftMetaArmor implements Colorable
}
return original != hash ? CraftMetaColorableArmor.class.hashCode() ^ hash : hash;
}
+
+ // Paper start - Expose #hasColor to leather armor
+ @Override
+ public boolean isDyed() {
+ return hasColor();
+ }
+ // Paper end - Expose #hasColor to leather armor
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
index 70c0d4cc85c045d040a35cd406f3f7ce9b6a58fa..0860d85fb9c6d0567f678569efb3c560f58612a9 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
@@ -183,4 +183,11 @@ class CraftMetaLeatherArmor extends CraftMetaItem implements LeatherArmorMeta {
builder.put(CraftMetaLeatherArmor.COLOR.BUKKIT, meta.getColor());
}
}
+
+ // Paper start - Expose #hasColor to leather armor
+ @Override
+ public boolean isDyed() {
+ return hasColor();
+ }
+ // Paper end - Expose #hasColor to leather armor
}