mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Subtraction goes down, not up. Silly me.
This commit is contained in:
parent
0a953a924a
commit
2d646ba400
@ -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;
|
||||
+ }
|
||||
+
|
||||
|
Loading…
Reference in New Issue
Block a user