Examples of NBTBase


Examples of net.minecraft.nbt.NBTBase

        catch (Exception e)
        {
            this.frequency = EnumWireFrequency.NONE;
        }
       
        NBTBase textureTag = tag.getTag("texture");
        if (textureTag instanceof NBTTagCompound) {
            try {
                this.textureItemStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) textureTag);
            }
            catch (Exception e)
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    // Extra Fields
    NBTTagList list = compound.getTagList( "extraFields" );
    if( list != null ) {
      int count = list.tagCount();
      for(int i=0; i<count; i++) {
        NBTBase tag = list.tagAt( i );
        if( tag != null ) {
          Object field = Utils.readFieldFromNBT( tag );
          String name = tag.getName();
          if( field != null ) {
            extraFields.put( name, field );
          }
        }
      }
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    oreIds.clear();
    for(int i=0;i<numItems;i++) {
      oreIds.add(null);
    }
    for (int i = 0; i < numItems; i++) {     
      NBTBase tag = nbtRoot.getTag("item" + i);
      if(tag instanceof NBTTagCompound) {
        items[i] = ItemStack.loadItemStackFromNBT((NBTTagCompound) tag);
      } else {
        items[i] = null;
      }
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    NBTBase.writeNamedTag(nbt, data);
  }

  @Override
  public void readData(DataInputStream data) throws IOException {
    NBTBase nbt = NBTBase.readNamedTag(data);
    if (nbt instanceof NBTTagCompound) {
      for (int i = 0; i < 6; ++i)
        connectionMatrix[i] = ((NBTTagCompound) nbt).getBoolean("connectionMatrix[" + i + "]");
      isDirty = true;
    }
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    NBTBase.writeNamedTag(nbt, data);
  }

  @Override
  public void readData(DataInputStream data) throws IOException {
    NBTBase nbt = NBTBase.readNamedTag(data);
    if (nbt instanceof NBTTagCompound) {
      for (int i = 0; i < fluids.length; ++i) {
        NBTTagCompound nbttagcompound = ((NBTTagCompound) nbt).getCompoundTag("fluidStack[" + i + "]");
        if (nbttagcompound != null)
          fluids[i] = FluidRegistry.getFluid(nbttagcompound.getString("FluidName"));
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    public void readFromNBT(NBTTagCompound nbttagcompound) {
      mappedPositions.clear();

      Collection<String> tags = nbttagcompound.func_150296_c();
      for(String key : tags) {
        NBTBase tag = nbttagcompound.getTag(key);
        if(tag instanceof NBTTagString) {
          String value = ((NBTTagString) tag).func_150285_a_();

          mappedPositions.put(key, value);
        }
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

        long energyStored = 0;

        if (itemStack.getTagCompound().hasKey(ENERGY_NBT))
        {
            // Backwards compatibility
            NBTBase obj = itemStack.getTagCompound().getTag(ENERGY_NBT);

            if (obj instanceof NBTTagFloat)
            {
                energyStored = (long) ((NBTTagFloat) obj).data;
            }
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    this.maxExtract = maxExtract;
  }

  public EnergyStorageHandler readFromNBT(NBTTagCompound nbt)
    {
        NBTBase energyTag = nbt.getTag("energy");
        if (energyTag instanceof NBTTagDouble)
        {
            this.energy = (long) ((NBTTagDouble) energyTag).data;
        }
        else if (energyTag instanceof NBTTagFloat)
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

            itemStack.setTagCompound(new NBTTagCompound());
        }
        float energyStored = 0f;
        if (itemStack.getTagCompound().hasKey("electricity"))
        {
            NBTBase obj = itemStack.getTagCompound().getTag("electricity");
            if (obj instanceof NBTTagDouble)
            {
                energyStored = ((NBTTagDouble) obj).func_150288_h();
            }
            else if (obj instanceof NBTTagFloat)
View Full Code Here

Examples of net.minecraft.nbt.NBTBase

    public static List<NBTTagCompound> getValues(NBTTagCompound nbt) {
        Set<String> keyset = (Set<String>) nbt.func_150296_c();
        ArrayList<NBTTagCompound> a = new ArrayList<NBTTagCompound>(keyset.size());
        for (String key : keyset) {
            NBTBase c = nbt.getTag(key);
            if (c instanceof NBTTagCompound) {
                a.add((NBTTagCompound) c);
            }
        }
        return a;
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.