aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2021-12-21 23:07:15 -0800
committerGitHub <[email protected]>2021-12-21 23:07:15 -0800
commit8a21c1742b0be0ca2bff8b79231d10d36ee6a34e (patch)
treee600eadf3385a4c84860555bb806996a268759c2 /patches/api
parent2cf6a57bca962f793b5f2a10da7b2f46e2c56627 (diff)
downloadPaper-8a21c1742b0be0ca2bff8b79231d10d36ee6a34e.tar.gz
Paper-8a21c1742b0be0ca2bff8b79231d10d36ee6a34e.zip
Add API for item entity health (#6514)
Diffstat (limited to 'patches/api')
-rw-r--r--patches/api/0350-Add-API-for-item-entity-health.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/api/0350-Add-API-for-item-entity-health.patch b/patches/api/0350-Add-API-for-item-entity-health.patch
new file mode 100644
index 0000000000..913f679ec0
--- /dev/null
+++ b/patches/api/0350-Add-API-for-item-entity-health.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sat, 28 Aug 2021 09:00:35 -0700
+Subject: [PATCH] Add API for item entity health
+
+
+diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
+index 0ee072645ecf1bf5feb74de6960947ef76db366e..87dbc00ab565377b8ae0eb6e73799ae6e2e3a376 100644
+--- a/src/main/java/org/bukkit/entity/Item.java
++++ b/src/main/java/org/bukkit/entity/Item.java
+@@ -119,5 +119,24 @@ public interface Item extends Entity {
+ * @param willAge True if the item should age
+ */
+ public void setWillAge(boolean willAge);
++
++ /**
++ * Gets the health of item stack.
++ * <p>
++ * Currently the default max health is 5.
++ *
++ * @return the health
++ */
++ public int getHealth();
++
++ /**
++ * Sets the health of the item stack. If the value is non-positive
++ * the itemstack's normal "on destroy" functionality will be run.
++ * <p>
++ * Currently, the default max health is 5.
++ *
++ * @param health the health, a non-positive value will destroy the entity
++ */
++ public void setHealth(int health);
+ // Paper end
+ }