aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch
new file mode 100644
index 0000000000..0d6b152103
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/item/crafting/Recipe.java.patch
@@ -0,0 +1,47 @@
+--- a/net/minecraft/world/item/crafting/Recipe.java
++++ b/net/minecraft/world/item/crafting/Recipe.java
+@@ -11,6 +11,7 @@
+ import net.minecraft.world.level.block.Blocks;
+
+ public interface Recipe<C extends Container> {
++
+ Codec<Recipe<?>> CODEC = BuiltInRegistries.RECIPE_SERIALIZER.byNameCodec().dispatch(Recipe::getSerializer, RecipeSerializer::codec);
+
+ boolean matches(C container, Level level);
+@@ -22,16 +23,17 @@
+ ItemStack getResultItem(RegistryAccess registryAccess);
+
+ default NonNullList<ItemStack> getRemainingItems(C container) {
+- NonNullList<ItemStack> list = NonNullList.withSize(container.getContainerSize(), ItemStack.EMPTY);
++ NonNullList<ItemStack> nonnulllist = NonNullList.withSize(container.getContainerSize(), ItemStack.EMPTY);
+
+- for (int i = 0; i < list.size(); i++) {
++ for (int i = 0; i < nonnulllist.size(); ++i) {
+ Item item = container.getItem(i).getItem();
++
+ if (item.hasCraftingRemainingItem()) {
+- list.set(i, new ItemStack(item.getCraftingRemainingItem()));
++ nonnulllist.set(i, new ItemStack(item.getCraftingRemainingItem()));
+ }
+ }
+
+- return list;
++ return nonnulllist;
+ }
+
+ default NonNullList<Ingredient> getIngredients() {
+@@ -59,7 +61,12 @@
+ RecipeType<?> getType();
+
+ default boolean isIncomplete() {
+- NonNullList<Ingredient> ingredients = this.getIngredients();
+- return ingredients.isEmpty() || ingredients.stream().anyMatch(ingredient -> ingredient.getItems().length == 0);
++ NonNullList<Ingredient> nonnulllist = this.getIngredients();
++
++ return nonnulllist.isEmpty() || nonnulllist.stream().anyMatch((recipeitemstack) -> {
++ return recipeitemstack.getItems().length == 0;
++ });
+ }
++
++ org.bukkit.inventory.Recipe toBukkitRecipe(org.bukkit.NamespacedKey id); // CraftBukkit
+ }