public class SlotCraftingCustom extends SlotCrafting {
private final InventoryCrafting craftMatrix;
private final IContainerCraftingCustom callback;
public SlotCraftingCustom(IContainerCraftingCustom callback, EntityPlayer player, InventoryCrafting craftingInventory, IInventory craftResult, int slotIndex, int xPosition, int yPosition) {
super(player, craftingInventory, craftResult, slotIndex, xPosition, yPosition);
this.craftMatrix = craftingInventory;
this.callback = callback;
}
@Override
@Nonnull
public ItemStack onTake(EntityPlayer playerIn, @Nonnull ItemStack stack) {
net.minecraftforge.fml.common.FMLCommonHandler.instance().firePlayerCraftingEvent(playerIn, stack, craftMatrix);
this.onCrafting(stack);
callback.onCrafting(playerIn, stack, craftMatrix);
return stack;
}
}