Package net.mcft.copy.betterstorage.api.crafting

Examples of net.mcft.copy.betterstorage.api.crafting.ContainerInfo


    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;
    }
   
View Full Code Here

TOP

Related Classes of net.mcft.copy.betterstorage.api.crafting.ContainerInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.