geforkt von Mirrors/Paper
Expose #hasColor to leather armor (#10638)
Dieser Commit ist enthalten in:
Ursprung
71c03637bf
Commit
a56d850e4b
25
patches/api/Expose-hasColor-to-leather-armor.patch
Normale Datei
25
patches/api/Expose-hasColor-to-leather-armor.patch
Normale Datei
@ -0,0 +1,25 @@
|
||||
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/inventory/meta/LeatherArmorMeta.java b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
@@ -0,0 +0,0 @@ public interface LeatherArmorMeta extends ItemMeta {
|
||||
@Override
|
||||
@NotNull
|
||||
LeatherArmorMeta clone();
|
||||
+
|
||||
+ // Paper start - Expose #hasColor to leather armor
|
||||
+ /**
|
||||
+ * Checks whether this leather armor is dyed
|
||||
+ * (i.e. has a color different from {@link ItemFactory#getDefaultLeatherColor()})
|
||||
+ *
|
||||
+ * @return whether this leather armor is dyed
|
||||
+ */
|
||||
+ boolean isDyed();
|
||||
+ // Paper end - Expose #hasColor to leather armor
|
||||
}
|
@ -1449,6 +1449,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
* {@link EquipmentSlot} will be returned. This is because
|
||||
* AttributeModifiers without a slot are active in any slot.<br>
|
||||
* If there are no attributes set for the given slot, an empty map
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/LeatherArmorMeta.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Represents leather armor ({@link Material#LEATHER_BOOTS}, {@link
|
||||
- * Material#LEATHER_CHESTPLATE}, {@link Material#LEATHER_HELMET}, or {@link
|
||||
- * Material#LEATHER_LEGGINGS}) that can be colored.
|
||||
+ * Material#LEATHER_LEGGINGS}, {@link Material#LEATHER_CHESTPLATE}, {@link
|
||||
+ * Material#LEATHER_HELMET}, or {@link Material#LEATHER_HORSE_ARMOR}) that can be colored.
|
||||
*/
|
||||
public interface LeatherArmorMeta extends ItemMeta {
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/scoreboard/Objective.java
|
||||
|
38
patches/server/Expose-hasColor-to-leather-armor.patch
Normale Datei
38
patches/server/Expose-hasColor-to-leather-armor.patch
Normale Datei
@ -0,0 +1,38 @@
|
||||
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaColorableArmor.java
|
||||
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaLeatherArmor.java
|
||||
@@ -0,0 +0,0 @@ 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
|
||||
}
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren