Paper/patches/server/1040-Expose-hasColor-to-leather-armor.patch
Riley Park f17519338b
Expose server build information (#10729)
* Expose server build information

* squash patches

* final tweaks

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: masmc05 <masmc05@gmail.com>
2024-05-15 17:06:59 -07: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 2c9ca54267579a210d4ea192517fc0fbce8e467a..ae94d09b8e0cac77db6a11f85890ff0fb51236f0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
@@ -116,4 +116,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 157a7b7351f48e68d2923c72ed3bbe3dcae21383..0368b2a557d3ee5d83474311fbd561480f9e8a2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
@@ -162,4 +162,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
}