Skip to content

Commit

Permalink
fix: Add support for itemstack-aware recipe remainders in Fabric, Twe…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Dec 7, 2023
1 parent 33232ff commit bfc4ef9
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import net.blay09.mods.balm.api.event.server.ServerStartedEvent;
import net.blay09.mods.balm.api.event.server.ServerStoppedEvent;
import net.blay09.mods.balm.api.fluid.FluidTank;
import net.fabricmc.fabric.api.item.v1.FabricItem;
import net.fabricmc.fabric.api.item.v1.FabricItemStack;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
Expand Down Expand Up @@ -69,6 +71,10 @@ public boolean isFakePlayer(Player player) {

@Override
public ItemStack getCraftingRemainingItem(ItemStack itemStack) {
if ((Object) itemStack instanceof FabricItemStack fabricItemStack) {
return fabricItemStack.getRecipeRemainder();
}

Item craftingRemainingItem = itemStack.getItem().getCraftingRemainingItem();
if (craftingRemainingItem != null) {
return new ItemStack(craftingRemainingItem);
Expand Down

0 comments on commit bfc4ef9

Please sign in to comment.