Package net.minecraft.item

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


    super.readFromNBT(nbttagcompound);
   
    if(nbttagcompound.hasKey("storedStack"))
    {
      ItemStack _storedStack = new ItemStack(0, 0, 0);
      _storedStack.readFromNBT((NBTTagCompound)nbttagcompound.getTag("storedStack"));
      _storedId = _storedStack.itemID;
      _storedMeta = _storedStack.getItemDamage();
    }
    else
    {
View Full Code Here


      return null;
    }
    else
    {
      ItemStack s = new ItemStack(0, 0, 0);
      s.readFromNBT(_stack.getTagCompound().getCompoundTag("ammo"));
      return s;
    }
  }

  @Override
View Full Code Here

  @Override
  public ItemStack decrStackSize(int i, int j)
  {
    ItemStack s = new ItemStack(0, 0, 0);
    s.readFromNBT(_stack.getTagCompound().getCompoundTag("ammo"));
    s.stackSize -= j;
    if(s.stackSize <= 0)
    {
      _stack.getTagCompound().setCompoundTag("ammo", new NBTTagCompound());
      s = null;
View Full Code Here

    boolean needsAmmo = stack.getTagCompound().getCompoundTag("ammo") == null || stack.getTagCompound().getCompoundTag("ammo").hasNoTags();
   
    if(!needsAmmo)
    {
      ItemStack ammo = new ItemStack(0, 0, 0);
      ammo.readFromNBT(stack.getTagCompound().getCompoundTag("ammo"));
     
      if(!player.worldObj.isRemote)
      {
        EntityNeedle needle = new EntityNeedle(world, player, ammo, 1.0F);
        world.spawnEntityInWorld(needle);
View Full Code Here

      NBTTagCompound nbttagcompound1 = (NBTTagCompound)nbttaglist.tagAt(i);
      int j = nbttagcompound1.getByte("Slot") & 0xff;
      if(j >= 0 && j < _inventory.length)
      {
        ItemStack s = new ItemStack(0, 0, 0);
        s.readFromNBT(nbttagcompound1);
        _inventory[j] = s;
      }
    }
    onFactoryInventoryChanged();
   
View Full Code Here

      for(int i = 0; i < tagList.tagCount(); i++) {
        NBTTagCompound itemTag = (NBTTagCompound)tagList.getCompoundTagAt(i);
        int slot = itemTag.getByte("Slot") & 0xff;
        if(slot >= 0 && slot <= _inventories.length) {
          ItemStack itemStack = new ItemStack((Block)null,0,0);
          itemStack.readFromNBT(itemTag);
          _inventories[slot] = itemStack;
        }
      }
    }
   
View Full Code Here

      for(int i = 0; i < tagList.tagCount(); i++) {
        NBTTagCompound itemTag = (NBTTagCompound)tagList.getCompoundTagAt(i);
        int slot = itemTag.getByte("Slot") & 0xff;
        if(slot >= 0 && slot <= _inventories.length) {
          ItemStack itemStack = new ItemStack((Block)null,0,0);
          itemStack.readFromNBT(itemTag);
          _inventories[slot] = itemStack;
        }
      }
    }
  }
View Full Code Here

      NBTTagCompound tagCompound = CompressedStreamTools.readCompressed(stream);

      if (tagCompound != null) {
        if (tagCompound.hasKey("Icon")) {
          ItemStack itemStack = Settings.defaultIcon.copy();
          itemStack.readFromNBT(tagCompound.getCompoundTag("Icon"));
          return itemStack;
        }
      }
    } catch (Exception e) {
      Settings.logger.log(e);
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.