Examples of writeToNBT()


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

    par1nbtTagCompound.setFloat(TAG_GRAVITY, getGravity());

    ItemStack stack = getSourceLens();
    NBTTagCompound lensCmp = new NBTTagCompound();
    if(stack != null)
      stack.writeToNBT(lensCmp);
    par1nbtTagCompound.setTag(TAG_LENS_STACK, lensCmp);

    ChunkCoordinates coords = getBurstSourceChunkCoordinates();
    par1nbtTagCompound.setInteger(TAG_SPREADER_X, coords.posX);
    par1nbtTagCompound.setInteger(TAG_SPREADER_Y, coords.posY);
View Full Code Here

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

                ItemStack stack = area.getStackInSlot(i);
                if (stack == null)
                    continue;
                NBTTagCompound stacksave = new NBTTagCompound();
                stacksave.setByte("Slot", (byte) i);
                stack.writeToNBT(stacksave);
                areaTag.appendTag(stacksave);
            }
            statesave.setTag(area.tagName, areaTag);
        }
View Full Code Here

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

        nbt.setInteger("SpaceshipTier", this.spaceshipTier);
        nbt.setInteger("FuelLevel", this.fuelLevel);
        if (this.rocketItem != null)
        {
          ItemStack returnRocket = new ItemStack(this.rocketItem, 1, this.rocketType);
          nbt.setTag("ReturnRocket", returnRocket.writeToNBT(new NBTTagCompound()));
        }
       
        final NBTTagList var2 = new NBTTagList();

        for (int var3 = 0; var3 < this.rocketStacks.length; ++var3)
View Full Code Here

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

            if (var3 != null)
            {
                NBTTagCompound var4 = new NBTTagCompound();
                var4.setByte("Slot", (byte) var2);
                var3.writeToNBT(var4);
                var1.appendTag(var4);
            }
        }

        return var1;
View Full Code Here

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

    compound = super.getDescriptionPacketData(compound)
    if (canHaveMaterial())
      compound.setString(ContainerMaterial.TAG_NAME, getMaterial().name);
    if (canHaveLock()) {
      ItemStack lock = getLockInternal();
      if (lock != null) compound.setTag("lock", lock.writeToNBT(new NBTTagCompound()));
    }
    return compound;
  }
 
  @Override
View Full Code Here

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

    if (canHaveMaterial())
      compound.setString(ContainerMaterial.TAG_NAME, getMaterial().name);
    if (canHaveLock()) {
      ItemStack lock = getLockInternal();
      if (lock != null)
        compound.setTag("lock", lock.writeToNBT(new NBTTagCompound()));
    }
  }
 
}
View Full Code Here

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

      NBTTagCompound regionCompound = new NBTTagCompound();
     
      ItemStack item;
      for (ArmorStandEquipHandler handler : BetterStorageArmorStand.getEquipHandlers(region))
        if ((item = getItem(handler)) != null)
          regionCompound.setTag(handler.id, item.writeToNBT(new NBTTagCompound()));
     
      items.setTag(region.toString(), regionCompound);
    }
    compound.setTag("Items", items);
  }
View Full Code Here

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

     
      backpackCompound.setInteger("count", backpackData.contents.length);
      backpackCompound.setTag("Items", NbtUtils.writeItems(backpackData.contents));
     
      if (!ItemBackpack.hasChestplateBackpackEquipped(entity))
        backpackCompound.setTag("Stack", backpack.writeToNBT(new NBTTagCompound()));
     
      persistent.setTag("Backpack", backpackCompound);
     
    } else {
     
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity.writeToNBT()

    if (block.hasTileEntity(meta)) {
      TileEntity tile = context.world().getTileEntity(x, y, z);

      if (tile != null) {
        tile.writeToNBT(cpt);
      }
    }
  }

  @Override
View Full Code Here

Examples of net.minecraft.tileentity.TileEntity.writeToNBT()

        if (card.isMemoryCard(currentItem))
        {
          if (player.isSneaking())
          {
            NBTTagCompound nbt = new NBTTagCompound();
            blockTE.writeToNBT(nbt);
            nbt.removeTag("x");
            nbt.removeTag("y");
            nbt.removeTag("z");
            blockTE.readFromNBT(nbt);
            card.setMemoryCardContents(currentItem, getUnlocalizedName() + ".name", nbt);
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.