fix CT recipe actions not running on crafting terminal crafts

This commit is contained in:
PrototypeTrousers
2023-10-11 17:08:23 -03:00
parent 4fe0d5e767
commit bfe82cdc0a
@@ -133,15 +133,18 @@ public class AppEngCraftingSlot extends AppEngSlot {
@Override
public ItemStack onTake(final EntityPlayer playerIn, final ItemStack stack) {
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, new WrapperInvItemHandler(this.craftMatrix));
this.onCrafting(stack);
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
stack.getItem().onCreated(stack, playerIn.world, playerIn);
final InventoryCrafting ic = new InventoryCrafting(this.getContainer(), 3, 3);
for (int x = 0; x < this.craftMatrix.getSlots(); x++) {
ic.setInventorySlotContents(x, this.craftMatrix.getStackInSlot(x));
}
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, ic);
net.minecraftforge.common.ForgeHooks.setCraftingPlayer(playerIn);
final NonNullList<ItemStack> aitemstack = this.getRemainingItems(ic, playerIn.world);
ItemHandlerUtil.copy(ic, this.craftMatrix, false);