Package net.minecraft.item

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


          inventory.setInventorySlotContents( slot.slotIndex, null );
        }
        if( toAdd != null ) {
          inventory.onInventoryChanged();
          if( stack == null ) {
            stack = toAdd.copy();
          } else {
            stack.stackSize += toAdd.stackSize;
          }
        }
        if( quantity <= 0 )
View Full Code Here


    ItemStack retValue = null;
    Slot slot = (Slot) this.inventorySlots.get( slotID );

    if( slot != null && slot.getHasStack() ) {
      ItemStack slotStack = slot.getStack();
      retValue = slotStack.copy();

      if( slotID == 0 ) { // output slot
        if( !this.mergeItemStack( slotStack, 10, 46, false ) ) { // changed last param to false.
          return null;
        }
View Full Code Here

          if( itemStack.stackSize > maxStackSize ) {
            remaining = itemStack.stackSize - maxStackSize;
            tempStack = itemStack.splitStack( maxStackSize );
          }

          slot.putStack( tempStack.copy() );
          slot.onSlotChanged();
          itemStack.stackSize = remaining;
          retValue = true;
          break;
        }
View Full Code Here

    FurnaceRecipes.smelting().func_151394_a(binderComposite, conduitBinder, 0);

    //Nuggets
    ItemStack phasedIronNugget = new ItemStack(EnderIO.itemMaterial, 9, Material.PHASED_IRON_NUGGET.ordinal());
    GameRegistry.addShapelessRecipe(phasedIronNugget, phasedIron);
    phasedIronNugget = phasedIronNugget.copy();
    phasedIronNugget.stackSize = 1;
    GameRegistry.addShapedRecipe(phasedIron, "eee", "eee", "eee", 'e', phasedIronNugget);

    ItemStack vibrantNugget = new ItemStack(EnderIO.itemMaterial, 9, Material.VIBRANT_NUGGET.ordinal());
    GameRegistry.addShapelessRecipe(vibrantNugget, phasedGold);
View Full Code Here

    phasedIronNugget.stackSize = 1;
    GameRegistry.addShapedRecipe(phasedIron, "eee", "eee", "eee", 'e', phasedIronNugget);

    ItemStack vibrantNugget = new ItemStack(EnderIO.itemMaterial, 9, Material.VIBRANT_NUGGET.ordinal());
    GameRegistry.addShapelessRecipe(vibrantNugget, phasedGold);
    vibrantNugget = vibrantNugget.copy();
    vibrantNugget.stackSize = 1;
    GameRegistry.addShapedRecipe(phasedGold, "eee", "eee", "eee", 'e', vibrantNugget);

    //Crystals
    ItemStack pulsCry = new ItemStack(EnderIO.itemMaterial, 1, Material.PULSATING_CYSTAL.ordinal());
View Full Code Here

    for (ItemStack req : required) {
      for (int i = 0; i < 9 && req.stackSize > 0; i++) {
        ItemStack avail = inventory[i];
        if(avail != null && avail.stackSize > 0 && avail.isItemEqual(req)) {
          req.stackSize--;
          avail = avail.copy();
          avail.stackSize--;
          if(avail.stackSize <= 0) {
            ItemStack used = avail.getItem().getContainerItem(avail);
            if(used != null) {
              if(used.isItemEqual(avail)) {
View Full Code Here

            ItemStack used = avail.getItem().getContainerItem(avail);
            if(used != null) {
              if(used.isItemEqual(avail)) {
                avail.stackSize++;
              } else {
                containerItems.add(used.copy());
                avail = null;
              }
            }
          }
          if(avail != null && avail.stackSize == 0) {
View Full Code Here

  private boolean hasRequiredInput(List<ItemStack> required) {
    List<ItemStack> available = new ArrayList<ItemStack>();
    for (int i = 0; i < 9; i++) {
      ItemStack is = inventory[i];
      if(is != null) {
        available.add(is.copy());
      }
    }
    for (ItemStack req : required) {
      boolean foundReq = false;
      for (ItemStack avail : available) {
View Full Code Here

    ItemStack itemstack = null;
    Slot slot = (Slot) this.inventorySlots.get(par2);

    if(slot != null && slot.getHasStack()) {
      ItemStack itemstack1 = slot.getStack();
      itemstack = itemstack1.copy();

      if(par2 < this.numRows * 9) {
        if(!this.mergeItemStack(itemstack1, this.numRows * 9, this.inventorySlots.size(), true)) {
          return null;
        }
View Full Code Here

    ItemStack copystack = null;
    Slot slot = (Slot) inventorySlots.get(slotIndex);
    if(slot != null && slot.getHasStack()) {

      ItemStack origStack = slot.getStack();
      copystack = origStack.copy();

      if(slotIndex < 4) {
        // merge from machine input slots to inventory
        if(!mergeItemStack(origStack, startPlayerSlot, endHotBarSlot, false)) {
          return null;
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.