Fix SmithingInventory helper slot methods for 1.20 (#9325)

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-12 10:04:53 -07:00 committet von GitHub
Ursprung eb0693fff7
Commit f8cfdd4ba9
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -178,51 +178,66 @@ index 4a0c43acc2714e095973eb78536041bb1a179ddc..acf2244f77133df53eb5f862c8e713c8
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/org/bukkit/inventory/SmithingInventory.java b/src/main/java/org/bukkit/inventory/SmithingInventory.java 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 --- a/src/main/java/org/bukkit/inventory/SmithingInventory.java
+++ b/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 @Nullable
Recipe getRecipe(); Recipe getRecipe();
+ +
+ // Paper start + // Paper start
+ /** + /**
+ * Gets the input equipment (first slot). + * Gets the input template (first slot).
+ * + *
+ * @return input equipment item + * @return input template item
+ */ + */
+ @Nullable + default @Nullable ItemStack getInputTemplate() {
+ default ItemStack getInputEquipment() { + return this.getItem(0);
+ return getItem(0);
+ } + }
+ +
+ /** + /**
+ * Sets the input equipment (first slot). + * 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
+ */
+ default @Nullable ItemStack getInputEquipment() {
+ return this.getItem(1);
+ }
+
+ /**
+ * Sets the input equipment (second slot).
+ * + *
+ * @param itemStack item to set + * @param itemStack item to set
+ */ + */
+ default void setInputEquipment(@Nullable ItemStack itemStack) { + 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 + * @return input mineral item
+ */ + */
+ @Nullable + default @Nullable ItemStack getInputMineral() {
+ default ItemStack getInputMineral() { + return this.getItem(2);
+ return getItem(1);
+ } + }
+ +
+ /** + /**
+ * Sets the input mineral (second slot). + * Sets the input mineral (third slot).
+ * + *
+ * @param itemStack item to set + * @param itemStack item to set
+ */ + */
+ default void setInputMineral(@Nullable ItemStack itemStack) { + default void setInputMineral(@Nullable ItemStack itemStack) {
+ setItem(1, itemStack); + this.setItem(2, itemStack);
+ } + }
+ // Paper end + // Paper end
} }