From 31e82c376ecd31b56d5e09b30ab489c4f750c88c Mon Sep 17 00:00:00 2001 From: ewoudje <7384674+ewoudje@users.noreply.github.com> Date: Fri, 8 Nov 2024 01:19:25 +0100 Subject: [PATCH] Use CommonHooks.getCraftingRemaining instead of IItemStackExtension --- .../world/item/crafting/BannerDuplicateRecipe.java.patch | 2 +- .../minecraft/world/item/crafting/BookCloningRecipe.java.patch | 2 +- .../minecraft/world/item/crafting/CraftingRecipe.java.patch | 3 ++- .../level/block/entity/AbstractFurnaceBlockEntity.java.patch | 2 +- .../level/block/entity/BrewingStandBlockEntity.java.patch | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/patches/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch b/patches/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch index 2a92e339c3..34d48ec2fc 100644 --- a/patches/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch +++ b/patches/net/minecraft/world/item/crafting/BannerDuplicateRecipe.java.patch @@ -5,7 +5,7 @@ ItemStack itemstack = p_345377_.getItem(i); if (!itemstack.isEmpty()) { - ItemStack itemstack1 = itemstack.getItem().getCraftingRemainder(); -+ ItemStack itemstack1 = itemstack.getCraftingRemainder(); ++ ItemStack itemstack1 = net.neoforged.neoforge.common.CommonHooks.getCraftingRemainder(itemstack); if (!itemstack1.isEmpty()) { nonnulllist.set(i, itemstack1); } else if (!itemstack.getOrDefault(DataComponents.BANNER_PATTERNS, BannerPatternLayers.EMPTY).layers().isEmpty()) { diff --git a/patches/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch b/patches/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch index ccfed826ab..0f6a15d8f9 100644 --- a/patches/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch +++ b/patches/net/minecraft/world/item/crafting/BookCloningRecipe.java.patch @@ -5,7 +5,7 @@ for (int i = 0; i < nonnulllist.size(); i++) { ItemStack itemstack = p_344763_.getItem(i); - ItemStack itemstack1 = itemstack.getItem().getCraftingRemainder(); -+ ItemStack itemstack1 = itemstack.getCraftingRemainder(); ++ ItemStack itemstack1 = net.neoforged.neoforge.common.CommonHooks.getCraftingRemainder(itemstack); if (!itemstack1.isEmpty()) { nonnulllist.set(i, itemstack1); } else if (itemstack.getItem() instanceof WrittenBookItem) { diff --git a/patches/net/minecraft/world/item/crafting/CraftingRecipe.java.patch b/patches/net/minecraft/world/item/crafting/CraftingRecipe.java.patch index 7ba401edc6..a72aa9276c 100644 --- a/patches/net/minecraft/world/item/crafting/CraftingRecipe.java.patch +++ b/patches/net/minecraft/world/item/crafting/CraftingRecipe.java.patch @@ -6,6 +6,7 @@ for (int i = 0; i < nonnulllist.size(); i++) { - Item item = p_380223_.getItem(i).getItem(); + ItemStack item = p_380223_.getItem(i); - nonnulllist.set(i, item.getCraftingRemainder()); +- nonnulllist.set(i, item.getCraftingRemainder()); ++ nonnulllist.set(i, net.neoforged.neoforge.common.CommonHooks.getCraftingRemainder(item)); } diff --git a/patches/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch b/patches/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch index 03bd036ae7..a0ace893bb 100644 --- a/patches/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch +++ b/patches/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch @@ -62,7 +62,7 @@ p_155017_.litDuration = p_155017_.litTime; if (p_155017_.isLit()) { flag1 = true; -+ var remainder = itemstack.getCraftingRemainder(); ++ var remainder = net.neoforged.neoforge.common.CommonHooks.getCraftingRemainder(itemstack); + if (!remainder.isEmpty()) + p_155017_.items.set(1, remainder); + else diff --git a/patches/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch b/patches/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch index 12d0923b2f..6c265da688 100644 --- a/patches/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch +++ b/patches/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java.patch @@ -13,7 +13,7 @@ } + net.neoforged.neoforge.event.EventHooks.onPotionBrewed(p_155293_); -+ ItemStack itemstack1 = itemstack.getCraftingRemainder(); ++ ItemStack itemstack1 = net.neoforged.neoforge.common.CommonHooks.getCraftingRemainder(itemstack); itemstack.shrink(1); - ItemStack itemstack1 = itemstack.getItem().getCraftingRemainder(); if (!itemstack1.isEmpty()) {