Examples of NBTTagCompound


Examples of net.minecraft.nbt.NBTTagCompound

    readCustomNBT(pkt.func_148857_g());
  }

  @Override
  public S35PacketUpdateTileEntity getDescriptionPacket() {
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    writeCustomNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

    camoMeta = cmp.getInteger(TAG_CAMO_META);
  }

  @Override
  public S35PacketUpdateTileEntity getDescriptionPacket() {
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    writeCustomNBT(nbttagcompound);
    return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbttagcompound);
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

            int strLength = font.getStringWidth(name);

            Gui.drawRect(xpos + 18, ypos, xpos + 18 + strLength + 4, ypos + 9, 0x66000000);
            font.drawStringWithShadow(name, xpos + 20, ypos, 0xFFAA00);

            NBTTagCompound cmp = ((ItemFocusDislocation) focus).getStackTileEntity(item);
            if (cmp != null && !cmp.hasNoTags()) {
              String content = StatCollector.translateToLocal("ttmisc.focusDislocation.tooltipExtra");
              font.getStringWidth(content);

              Gui.drawRect(xpos + 18, ypos + 9, xpos + 18 + strLength + 4, ypos + 18, 0x66000000);
              font.drawStringWithShadow(content, xpos + 20, ypos + 9, 0xFFAA00);
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

    container = gui;
    inventory = stack;
    inventoryItem = (IInventoryContainerItem) stack.getItem();

    if (inventory.stackTagCompound == null) {
      inventory.setTagCompound(new NBTTagCompound());
    }
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

      return null;
    }
    ItemStack stack = ItemStack.loadItemStackFromNBT(inventory.stackTagCompound.getCompoundTag("Slot" + slot));
    ItemStack retStack = stack.splitStack(amount);
    if (stack.stackSize <= 0) {
      inventory.stackTagCompound.setTag("Slot" + slot, new NBTTagCompound());
    } else {
      NBTTagCompound itemTag = new NBTTagCompound();
      stack.writeToNBT(itemTag);
      inventory.stackTagCompound.setTag("Slot" + slot, itemTag);
    }
    return retStack;
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

  @Override
  public void setInventorySlotContents(int slot, ItemStack stack) {

    if (stack == null) {
      inventory.stackTagCompound.setTag("Slot" + slot, new NBTTagCompound());
    } else {
      NBTTagCompound itemTag = new NBTTagCompound();
      stack.writeToNBT(itemTag);
      inventory.stackTagCompound.setTag("Slot" + slot, itemTag);
    }
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

    if (name == "") {
      return null;
    }
    if (tag == null) {
      tag = new NBTTagCompound();
    }
    if (!tag.hasKey("display")) {
      tag.setTag("display", new NBTTagCompound());
    }
    tag.getCompoundTag("display").setString("Name", name);

    return tag;
  }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

    ArrayList<ItemStack> containedItems = new ArrayList<ItemStack>();

    boolean[] visited = new boolean[nbtList.tagCount()];

    for (int i = 0; i < nbtList.tagCount(); i++) {
      NBTTagCompound tag = nbtList.getCompoundTagAt(i);
      int slot = tag.getInteger("Slot");

      if (visited[i] || slot < minSlot || slot > maxSlot) {
        continue;
      }
      visited[i] = true;
      curStack = ItemStack.loadItemStackFromNBT(tag);

      if (curStack == null) {
        continue;
      }
      containedItems.add(curStack);
      for (int j = 0; j < nbtList.tagCount(); j++) {
        NBTTagCompound tag2 = nbtList.getCompoundTagAt(j);
        int slot2 = tag.getInteger("Slot");

        if (visited[j] || slot2 < minSlot || slot2 > maxSlot) {
          continue;
        }
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

      return;
    }
    NBTTagList list = new NBTTagList();
    for (int i = 0; i < augments.length; i++) {
      if (augments[i] != null) {
        NBTTagCompound tag = new NBTTagCompound();
        tag.setInteger("Slot", i);
        augments[i].writeToNBT(tag);
        list.appendTag(tag);
      }
    }
    nbt.setTag("Augments", list);
View Full Code Here

Examples of net.minecraft.nbt.NBTTagCompound

    if (augments.length <= 0) {
      return;
    }
    if (stack.stackTagCompound == null) {
      stack.setTagCompound(new NBTTagCompound());
    }
    NBTTagList list = new NBTTagList();
    for (int i = 0; i < augments.length; i++) {
      if (augments[i] != null) {
        NBTTagCompound tag = new NBTTagCompound();
        tag.setInteger("Slot", i);
        augments[i].writeToNBT(tag);
        list.appendTag(tag);
      }
    }
    stack.stackTagCompound.setTag("Augments", list);
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.