mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 22:43:14 +01:00
Subtraction goes down, not up. Silly me.
This commit is contained in:
parent
b922ff9886
commit
5659d66915
1 changed files with 4 additions and 4 deletions
|
@ -1,11 +1,11 @@
|
||||||
From 79f36b1b98d9b888c633ef39dc73b532c89691b9 Mon Sep 17 00:00:00 2001
|
From 503daef70a79ca4ea4f0583e6442c17aa74a94ee Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Fri, 22 Jun 2018 22:59:18 -0400
|
Date: Fri, 22 Jun 2018 22:59:18 -0400
|
||||||
Subject: [PATCH] ItemStack API additions for quantity/flags/lore
|
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
|
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
|
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||||
@@ -2,7 +2,9 @@ package org.bukkit.inventory;
|
@@ -2,7 +2,9 @@ package org.bukkit.inventory;
|
||||||
|
@ -85,7 +85,7 @@ index 82240129..bfd6307f 100644
|
||||||
+ * @return The same item (not a clone)
|
+ * @return The same item (not a clone)
|
||||||
+ */
|
+ */
|
||||||
+ public ItemStack subtract(int qty) {
|
+ public ItemStack subtract(int qty) {
|
||||||
+ setAmount(Math.max(0, getAmount() + qty));
|
+ setAmount(Math.max(0, getAmount() - qty));
|
||||||
+ return this;
|
+ return this;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -162,5 +162,5 @@ index 82240129..bfd6307f 100644
|
||||||
// Paper end
|
// Paper end
|
||||||
}
|
}
|
||||||
--
|
--
|
||||||
2.17.1
|
2.18.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue