checkHasRequirements = true;
}
private ItemStack craftSlot(ItemStack stack, IRecipeInput requiredInput, EntityPlayer player, boolean simulate) {
if (simulate) stack = stack.copy();
ContainerInfo containerInfo = new ContainerInfo();
requiredInput.craft(stack, containerInfo);
ItemStack containerItem = ItemStack.copyItemStack(containerInfo.getContainerItem());
boolean removeStack = false;
if (stack.stackSize <= 0) {
// Item stack is depleted.
removeStack = true;
} else if (stack.getItem().isDamageable() && (stack.getItemDamage() > stack.getMaxDamage())) {
// Item stack is destroyed.
removeStack = true;
if (player != null)
MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, stack));
}
// If the stack has been depleted, set it
// to either null, or the container item.
if (removeStack) {
if (!containerInfo.doesLeaveCrafting()) {
stack = containerItem;
containerItem = null;
} else stack = null;
}