Examples of writeToNBT()


Examples of mods.railcraft.common.fluids.tanks.StandardTank.writeToNBT()

        for (byte slot = 0; slot < tanks.size(); slot++) {
            StandardTank tank = tanks.get(slot);
            if (tank.getFluid() != null) {
                NBTTagCompound tag = new NBTTagCompound();
                tag.setByte("tank", slot);
                tank.writeToNBT(tag);
                tagList.appendTag(tag);
            }
        }
        data.setTag("tanks", tagList);
    }
View Full Code Here

Examples of net.minecraft.entity.monster.EntityCreeper.writeToNBT()

    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWolf.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityBat.class, world), 35));
   
    EntityCreeper chargedCreeper = (EntityCreeper)MFRUtil.prepareMob(EntityCreeper.class, world);
    NBTTagCompound creeperNBT = new NBTTagCompound();
    chargedCreeper.writeToNBT(creeperNBT);
    creeperNBT.setBoolean("powered", true);
    creeperNBT.setShort("Fuse", (short)120);
    chargedCreeper.readFromNBT(creeperNBT);
    mobs.add(new RandomMob(chargedCreeper, 5));
   
View Full Code Here

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

    }
    for (int i = 0; i < password.length; i++) {
      ItemStack stack = password[i];
      if(stack != null) {
        NBTTagCompound stackRoot = new NBTTagCompound();
        stack.writeToNBT(stackRoot);
        root.setTag("password" + i, stackRoot);
      }
    }
    StringBuffer userStr = new StringBuffer();
    for (String user : authorisedUsers) {
View Full Code Here

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

  public void writeToNBT(NBTTagCompound nbtRoot) {
    for (int i = 0; i < items.length; i++) {
      ItemStack stack = items[i];
      if(stack != null) {
        NBTTagCompound stackRoot = new NBTTagCompound();
        stack.writeToNBT(stackRoot);
        nbtRoot.setTag("recieveBuffer" + i, stackRoot);
      }
    }

  }
View Full Code Here

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

    for (Entry<ForgeDirection, ItemStack> entry : speedUpgrades.entrySet()) {
      if(entry.getValue() != null) {
        ItemStack up = entry.getValue();
        NBTTagCompound itemRoot = new NBTTagCompound();
        up.writeToNBT(itemRoot);
        nbtRoot.setTag("speedUpgrades." + entry.getKey().name(), itemRoot);
      }
    }

    for (Entry<ForgeDirection, IItemFilter> entry : outputFilters.entrySet()) {
View Full Code Here

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

        ItemStack up = entry.getValue();
        IItemFilter filter = getInputFilter(entry.getKey());
        FilterRegister.writeFilterToStack(filter, up);

        NBTTagCompound itemRoot = new NBTTagCompound();
        up.writeToNBT(itemRoot);
        nbtRoot.setTag("inputFilterUpgrades." + entry.getKey().name(), itemRoot);
      }
    }

    for (Entry<ForgeDirection, ItemStack> entry : outputFilterUpgrades.entrySet()) {
View Full Code Here

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

        ItemStack up = entry.getValue();
        IItemFilter filter = getOutputFilter(entry.getKey());
        FilterRegister.writeFilterToStack(filter, up);

        NBTTagCompound itemRoot = new NBTTagCompound();
        up.writeToNBT(itemRoot);
        nbtRoot.setTag("outputFilterUpgrades." + entry.getKey().name(), itemRoot);
      }
    }

    for (Entry<ForgeDirection, RedstoneControlMode> entry : extractionModes.entrySet()) {
View Full Code Here

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

      s = null;
    }
    else
    {
      NBTTagCompound t = new NBTTagCompound();
      s.writeToNBT(t);
      _stack.getTagCompound().setCompoundTag("ammo", t);
    }
    return s;
  }
View Full Code Here

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

      NBTTagCompound t = new NBTTagCompound();
      ammo.setItemDamage(ammo.getItemDamage() + 1);
      if(ammo.getItemDamage() <= ammo.getMaxDamage())
      {
        ammo.writeToNBT(t);
      }
      else
      {
        for(int i = 0; i < 36; i++)
        {
View Full Code Here

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

        {
          if(player.inventory.mainInventory[i] != null && player.inventory.mainInventory[i].itemID == ammo.itemID)
          {
            player.inventory.decrStackSize(i, 1);
            ammo.setItemDamage(0);
            ammo.writeToNBT(t);
            break;
          }
        }
       
        if(!world.isRemote)
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.