Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-15 11:00:06 +01:00
Subtraction goes down, not up. Silly me.
Dieser Commit ist enthalten in:
Ursprung
b922ff9886
Commit
5659d66915
@ -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>
|
||||
Date: Fri, 22 Jun 2018 22:59:18 -0400
|
||||
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
|
||||
@@ -2,7 +2,9 @@ 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;
|
||||
+ }
|
||||
+
|
||||
@ -162,5 +162,5 @@ index 82240129..bfd6307f 100644
|
||||
// Paper end
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
2.18.0
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren