Subtraction goes down, not up. Silly me.

This commit is contained in:
Aikar 2018-06-30 04:45:17 -04:00
parent 0a953a924a
commit 2d646ba400

View File

@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 82240129..bfd6307f 100644
index 82240129..574cdf3b 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -0,0 +0,0 @@ package org.bukkit.inventory;
@ -85,7 +85,7 @@ index 82240129..bfd6307f 100644
+ * @return The same item (not a clone)
+ */
+ public ItemStack subtract(int qty) {
+ setAmount(Math.max(0, getAmount() + qty));
+ setAmount(Math.max(0, getAmount() - qty));
+ return this;
+ }
+