Skip to content

Commit

Permalink
Use CommonHooks.getCraftingRemaining instead of IItemStackExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudje committed Nov 8, 2024
1 parent 3b02552 commit 31e82c3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit 31e82c3

Please sign in to comment.