aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-06-12 10:04:53 -0700
committerGitHub <[email protected]>2023-06-12 19:04:53 +0200
commitf8cfdd4ba979c95703c51684cd305ad5a7e13cdd (patch)
tree6fc757dc4b3b48a558be1698376853ba3bb7dc67
parenteb0693fff78f57402e4cd9eb313146a4eb052589 (diff)
downloadPaper-f8cfdd4ba979c95703c51684cd305ad5a7e13cdd.tar.gz
Paper-f8cfdd4ba979c95703c51684cd305ad5a7e13cdd.zip
Fix SmithingInventory helper slot methods for 1.20 (#9325)
-rw-r--r--patches/api/0192-Add-item-slot-convenience-methods.patch43
1 files changed, 29 insertions, 14 deletions
diff --git a/patches/api/0192-Add-item-slot-convenience-methods.patch b/patches/api/0192-Add-item-slot-convenience-methods.patch
index abad4883ed..3f2480123e 100644
--- a/patches/api/0192-Add-item-slot-convenience-methods.patch
+++ b/patches/api/0192-Add-item-slot-convenience-methods.patch
@@ -178,51 +178,66 @@ index 4a0c43acc2714e095973eb78536041bb1a179ddc..acf2244f77133df53eb5f862c8e713c8
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/SmithingInventory.java b/src/main/java/org/bukkit/inventory/SmithingInventory.java
-index 96d526b7b153e56c9a97de42ce3270b6638510e4..a41ca6bd2672db2810dd70c4925b84a4f081af05 100644
+index 96d526b7b153e56c9a97de42ce3270b6638510e4..5ed72b7305428f6be98a86fa9aa174d1b8ad4c17 100644
--- a/src/main/java/org/bukkit/inventory/SmithingInventory.java
+++ b/src/main/java/org/bukkit/inventory/SmithingInventory.java
-@@ -30,4 +30,44 @@ public interface SmithingInventory extends Inventory {
+@@ -30,4 +30,59 @@ public interface SmithingInventory extends Inventory {
*/
@Nullable
Recipe getRecipe();
+
+ // Paper start
+ /**
-+ * Gets the input equipment (first slot).
++ * Gets the input template (first slot).
++ *
++ * @return input template item
++ */
++ default @Nullable ItemStack getInputTemplate() {
++ return this.getItem(0);
++ }
++
++ /**
++ * Sets the input template (first slot).
++ *
++ * @param itemStack item to set
++ */
++ default void setInputTemplate(@Nullable ItemStack itemStack) {
++ this.setItem(0, itemStack);
++ }
++ /**
++ * Gets the input equipment (second slot).
+ *
+ * @return input equipment item
+ */
-+ @Nullable
-+ default ItemStack getInputEquipment() {
-+ return getItem(0);
++ default @Nullable ItemStack getInputEquipment() {
++ return this.getItem(1);
+ }
+
+ /**
-+ * Sets the input equipment (first slot).
++ * Sets the input equipment (second slot).
+ *
+ * @param itemStack item to set
+ */
+ default void setInputEquipment(@Nullable ItemStack itemStack) {
-+ setItem(0, itemStack);
++ this.setItem(1, itemStack);
+ }
+
+ /**
-+ * Gets the input mineral (second slot).
++ * Gets the input mineral (third slot).
+ *
+ * @return input mineral item
+ */
-+ @Nullable
-+ default ItemStack getInputMineral() {
-+ return getItem(1);
++ default @Nullable ItemStack getInputMineral() {
++ return this.getItem(2);
+ }
+
+ /**
-+ * Sets the input mineral (second slot).
++ * Sets the input mineral (third slot).
+ *
+ * @param itemStack item to set
+ */
+ default void setInputMineral(@Nullable ItemStack itemStack) {
-+ setItem(1, itemStack);
++ this.setItem(2, itemStack);
+ }
+ // Paper end
}