mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Fix SmithingInventory helper slot methods for 1.20 (#9325)
This commit is contained in:
parent
04928c58a4
commit
a7397ad665
1 changed files with 28 additions and 13 deletions
|
@ -188,41 +188,56 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ // Paper start
|
||||
+ /**
|
||||
+ * Gets the input equipment (first slot).
|
||||
+ * Gets the input template (first slot).
|
||||
+ *
|
||||
+ * @return input equipment item
|
||||
+ * @return input template item
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ default ItemStack getInputEquipment() {
|
||||
+ return getItem(0);
|
||||
+ default @Nullable ItemStack getInputTemplate() {
|
||||
+ return this.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
|
||||
+ */
|
||||
+ 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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue