13
0
geforkt von Mirrors/Paper

Fix SmithingInventory helper slot methods for 1.20 (#9325)

Dieser Commit ist enthalten in:
Jake Potrebic 2023-06-12 10:04:53 -07:00
Ursprung 04928c58a4
Commit a7397ad665

Datei anzeigen

@ -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
}