mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 12:13:54 -07:00
Delegate ItemStack (#10852)
This commit is contained in:
@@ -19,3 +19,55 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.flicker = flicker;
|
||||
this.trail = trail;
|
||||
this.colors = colors;
|
||||
diff --git a/src/main/java/org/bukkit/inventory/meta/Damageable.java b/src/main/java/org/bukkit/inventory/meta/Damageable.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/meta/Damageable.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/meta/Damageable.java
|
||||
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
|
||||
public interface Damageable extends ItemMeta {
|
||||
|
||||
/**
|
||||
- * Checks to see if this item has damage
|
||||
+ * Checks to see if this item has damage greater than 0.
|
||||
*
|
||||
- * @return true if this has damage
|
||||
+ * @return true if this has damage > 0
|
||||
*/
|
||||
boolean hasDamage();
|
||||
|
||||
/**
|
||||
* Gets the damage
|
||||
+ * <p>
|
||||
+ * Call {@link #hasDamageValue()} to be sure
|
||||
+ * a damage value is set.
|
||||
*
|
||||
* @return the damage
|
||||
*/
|
||||
@@ -0,0 +0,0 @@ public interface Damageable extends ItemMeta {
|
||||
* Sets the damage
|
||||
*
|
||||
* @param damage item damage
|
||||
+ * @see #resetDamage() to reset and clear the damage data component
|
||||
*/
|
||||
void setDamage(int damage);
|
||||
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Checks if any damage value, including 0,
|
||||
+ * is set on this meta.
|
||||
+ *
|
||||
+ * @return true if any value is set
|
||||
+ */
|
||||
+ boolean hasDamageValue();
|
||||
+
|
||||
+ /**
|
||||
+ * Clears the damage component from the meta. Differs
|
||||
+ * from {@code setDamage(0)} in that it removes the component
|
||||
+ * instead of adding the component with a value of 0.
|
||||
+ */
|
||||
+ void resetDamage();
|
||||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Checks to see if this item has a maximum amount of damage.
|
||||
*
|
||||
|
Reference in New Issue
Block a user