Package net.minecraft.item

Examples of net.minecraft.item.ItemStack.copy()


    ItemStack pureFluix = Api.instance.materials().materialPureifiedFluixCrystal.stack(1).copy();
    ItemStack quartzFiber = Api.instance.parts().partQuartzFiber.stack(1).copy();
    ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
    ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
   
    GameRegistry.addRecipe(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', fluix, 'q', quartzFiber);
    GameRegistry.addRecipe(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', pureFluix, 'q', quartzFiber);
  }
}
View Full Code Here


    ItemStack quartzFiber = Api.instance.parts().partQuartzFiber.stack(1).copy();
    ItemStack conduitBinder = new ItemStack(EnderIO.itemMaterial, 1, Material.CONDUIT_BINDER.ordinal());
    ItemStack res = new ItemStack(EnderIO.itemMEConduit, Config.numConduitsPerRecipe / 2);
   
    GameRegistry.addRecipe(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', fluix, 'q', quartzFiber);
    GameRegistry.addRecipe(res.copy(), "bbb", "fqf", "bbb", 'b', conduitBinder, 'f', pureFluix, 'q', quartzFiber);
  }
}
View Full Code Here

      }
    }

    if (Settings.USE_CACHE)
    {
      this.cache.put(cacheID, returnStack.copy());
    }

    return returnStack;
  }
View Full Code Here

        }
        return null;
      }
      else if (stackInInventory.isItemEqual(itemStack) && stackInInventory.isStackable())
      {
        stackInInventory = stackInInventory.copy();
        int stackLim = Math.min(inventory.getInventoryStackLimit(), itemStack.getMaxStackSize());
        int rejectedAmount = Math.max((stackInInventory.stackSize + itemStack.stackSize) - stackLim, 0);
        stackInInventory.stackSize = Math.min(Math.max((stackInInventory.stackSize + itemStack.stackSize - rejectedAmount), 0), inventory.getInventoryStackLimit());
        itemStack.stackSize = rejectedAmount;
        inventory.setInventorySlotContents(slotIndex, stackInInventory);
View Full Code Here

        ItemStack itemstack = null;
        Slot slot = (Slot) inventorySlots.get(i);
        if (slot != null && slot.getHasStack())
        {
            ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();
            if (i < type.size)
            {
                if (!mergeItemStack(itemstack1, type.size, inventorySlots.size(), true))
                {
                    return null;
View Full Code Here

    Slot currentSlot = (Slot)inventorySlots.get(slotID);

    if(currentSlot != null && currentSlot.getHasStack())
    {
      ItemStack slotStack = currentSlot.getStack();
      stack = slotStack.copy();

      if(ChargeUtils.canBeDischarged(slotStack))
      {
        if(slotID != 0)
        {
View Full Code Here

    Slot currentSlot = (Slot)inventorySlots.get(slotID);

    if(currentSlot != null && currentSlot.getHasStack())
    {
      ItemStack slotStack = currentSlot.getStack();
      stack = slotStack.copy();

      if(ChargeUtils.canBeCharged(slotStack) || ChargeUtils.canBeDischarged(slotStack))
      {
        if(slotStack.getItem() == Items.redstone)
        {
View Full Code Here

    Slot currentSlot = (Slot)inventorySlots.get(slotID);

    if(currentSlot != null && currentSlot.getHasStack())
    {
      ItemStack slotStack = currentSlot.getStack();
      stack = slotStack.copy();

      if(slotID == 2)
      {
        if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
        {
View Full Code Here

    Slot currentSlot = (Slot)inventorySlots.get(slotID);

    if(currentSlot != null && currentSlot.getHasStack())
    {
      ItemStack slotStack = currentSlot.getStack();
      stack = slotStack.copy();

      if(slotID == 2)
      {
        if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
        {
View Full Code Here

    Slot currentSlot = (Slot)inventorySlots.get(slotID);

    if(currentSlot != null && currentSlot.getHasStack())
    {
      ItemStack slotStack = currentSlot.getStack();
      stack = slotStack.copy();

      if(slotID == 2 || slotID == 4)
      {
        if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
        {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.