Examples of appendTag()


Examples of net.minecraft.nbt.NBTTagList.appendTag()

    for (int i = 0; i < inventory.length; i++) {
      if(inventory[i] != null) {
        NBTTagCompound itemStackNBT = new NBTTagCompound();
        itemStackNBT.setByte("Slot", (byte) i);
        inventory[i].writeToNBT(itemStackNBT);
        itemList.appendTag(itemStackNBT);
      }
    }
    nbtRoot.setTag("Items", itemList);

    //face modes
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

    for (int i = 0; i < inv.length; i++) {
      if(inv[i] != null) {
        NBTTagCompound itemStackNBT = new NBTTagCompound();
        itemStackNBT.setByte("Slot", (byte) i);
        inv[i].writeToNBT(itemStackNBT);
        itemList.appendTag(itemStackNBT);
      }
    }
    nbtRoot.setTag("Items", itemList);
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

  public void toBytes(ByteBuf buf) {
    NBTTagList tagList = new NBTTagList();
    for(Channel chan : channels) {
      NBTTagCompound tag = new NBTTagCompound();
      chan.writeToNBT(tag);
      tagList.appendTag(tag);
    }
    NBTTagCompound root = new NBTTagCompound();
    root.setTag("chanList", tagList);
    NetworkUtil.writeNBTTagCompound(root, buf);
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

    for (int i = 0; i < inv.length; i++) {
      if(inv[i] != null) {
        NBTTagCompound itemStackNBT = new NBTTagCompound();
        itemStackNBT.setByte("Slot", (byte) i);
        inv[i].writeToNBT(itemStackNBT);
        itemList.appendTag(itemStackNBT);
      }
    }
    nbtRoot.setTag("Items", itemList);
  }
   
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

    for (int i = 0; i < inv.length; i++) {
      if(inv[i] != null) {
        NBTTagCompound itemStackNBT = new NBTTagCompound();
        itemStackNBT.setByte("Slot", (byte) i);
        inv[i].writeToNBT(itemStackNBT);
        itemList.appendTag(itemStackNBT);
      }
    }
    root.setTag("Items", itemList);
    root.setShort("facing", facing);
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

    NBTTagList res = new NBTTagList();
    for (List<Channel> chanList : chans.values()) {
      for (Channel channel : chanList) {
        NBTTagCompound chanTag = new NBTTagCompound();
        channel.writeToNBT(chanTag);
        res.appendTag(chanTag);
      }
    }
    return res;
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

    for (Fluid f : fluids) {
      if(f != null) {
        NBTTagCompound fRoot = new NBTTagCompound();
        fRoot.setInteger("index", index);
        fRoot.setString("fluidName", f.getName());
        fluidList.appendTag(fRoot);
      }
      index++;
    }
    root.setTag("fluidFilter", fluidList);
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

  public void writeToNBT(NBTTagCompound nbtRoot) {
    super.writeToNBT(nbtRoot);
    NBTTagList list = new NBTTagList();
    for (ForgeDirection dir : validConnections) {
      NBTTagString name = new NBTTagString(dir.name());
      list.appendTag(name);
    }
    nbtRoot.setTag("validConnections", list);
  }

  @Override
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

      int i = 0;
      for (ItemStack item : snapshot) {               
        if(item != null) {
          NBTTagCompound itemTag = new NBTTagCompound();
          item.writeToNBT(itemTag);
          itemList.appendTag(itemTag);
        }
        i++;
      }
      nbtRoot.setTag("snapshot", itemList);
     
View Full Code Here

Examples of net.minecraft.nbt.NBTTagList.appendTag()

      if (this.inventory[i] != null)
      {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Slot", (byte) i);
        this.inventory[i].writeToNBT(nbttagcompound1);
        nbtTagList.appendTag(nbttagcompound1);
      }
    }

    nbttagcompound.setTag("Items", nbtTagList);
  }
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.