Initial 1.18.1 update

This commit is contained in:
lexikiq
2021-12-26 21:42:55 -05:00
parent 684ee059ea
commit 8bb5b1f601
28 changed files with 368 additions and 394 deletions

View File

@@ -7,13 +7,13 @@ Temporary API to get the result of smelting an item in a (type of) furnace.
Will eventually (hopefully) be replaced by a more extensive Paper PR with support for all recipes.
diff --git a/src/main/java/me/lexikiq/inventory/RecipeType.java b/src/main/java/me/lexikiq/inventory/RecipeType.java
diff --git a/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java
new file mode 100644
index 0000000000000000000000000000000000000000..f8f707483bf08142cdaf6c6ff9b1241832e9134f
index 0000000000000000000000000000000000000000..28c01caa9d6379046f6af6612719b40459a89d17
--- /dev/null
+++ b/src/main/java/me/lexikiq/inventory/RecipeType.java
+++ b/src/main/java/gg/projecteden/parchment/inventory/RecipeType.java
@@ -0,0 +1,50 @@
+package me.lexikiq.inventory;
+package gg.projecteden.parchment.inventory;
+
+/**
+ * A type of crafting recipe.
@@ -64,10 +64,10 @@ index 0000000000000000000000000000000000000000..f8f707483bf08142cdaf6c6ff9b12418
+ }
+}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4f673e9123145dc78564dc3eef0edf75795dafc2..85902538dae4a76ee79bc2d9921f2b4ec9f3c30d 100644
index 1f8a51897d9de00f0004ab1de479198390483f7d..a74ee256922b220c1de31bb9784a78ffde59499d 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -3764,6 +3764,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -3772,6 +3772,36 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -80,17 +80,17 @@ index 4f673e9123145dc78564dc3eef0edf75795dafc2..85902538dae4a76ee79bc2d9921f2b4e
+ */
+ @Nullable
+ default ItemStack smeltItem(@NotNull ItemStack toSmelt) {
+ return smeltItem(toSmelt, me.lexikiq.inventory.RecipeType.SMELTING);
+ return smeltItem(toSmelt, gg.projecteden.parchment.inventory.RecipeType.SMELTING);
+ }
+
+ /**
+ * Returns the item that will result from smelting the input item, if applicable.
+ * <p>
+ * Applicable values for {@code recipeType} are
+ * {@link me.lexikiq.inventory.RecipeType#SMELTING SMELTING},
+ * {@link me.lexikiq.inventory.RecipeType#BLASTING BLASTING},
+ * {@link me.lexikiq.inventory.RecipeType#SMOKING SMOKING},
+ * and {@link me.lexikiq.inventory.RecipeType#CAMPFIRE_COOKING CAMPFIRE_COOKING}.
+ * {@link gg.projecteden.parchment.inventory.RecipeType#SMELTING SMELTING},
+ * {@link gg.projecteden.parchment.inventory.RecipeType#BLASTING BLASTING},
+ * {@link gg.projecteden.parchment.inventory.RecipeType#SMOKING SMOKING},
+ * and {@link gg.projecteden.parchment.inventory.RecipeType#CAMPFIRE_COOKING CAMPFIRE_COOKING}.
+ * An {@link IllegalArgumentException} will be thrown if another value is supplied.
+ *
+ * @param toSmelt the item to simulate smelting
@@ -98,7 +98,7 @@ index 4f673e9123145dc78564dc3eef0edf75795dafc2..85902538dae4a76ee79bc2d9921f2b4e
+ * @return the resulting item, or null
+ */
+ @Nullable
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, me.lexikiq.inventory.@NotNull RecipeType recipeType);
+ ItemStack smeltItem(@NotNull ItemStack toSmelt, gg.projecteden.parchment.inventory.@NotNull RecipeType recipeType);
+ // Parchment end
+
/**