Package net.minecraft.nbt

Examples of net.minecraft.nbt.NBTTagCompound.copy()


    ItemStack basic = ForestryBlock.farm.getItemStack(1, 0);
    for (EnumFarmBlock block : EnumFarmBlock.values()) {
      NBTTagCompound compound = new NBTTagCompound();
      block.saveToCompound(compound);

      basic.setTagCompound((NBTTagCompound) compound.copy());
      ShapedRecipeCustom.buildRecipe(basic.copy(), "I#I", "WCW", '#', block.getCraftingIngredient(), 'W', "slabWood", 'C', ForestryItem.tubes.getItemStack(1, 1), 'I', "ingotCopper");

    }

    ItemStack gearbox = ForestryBlock.farm.getItemStack(1, 2);
View Full Code Here


                      {
                        TileEntity ote = src_w.getTileEntity( min_x + i, min_y + j, min_z + k );
                        TileEntity nte = blk.createTileEntity( world, meta );
                        NBTTagCompound data = new NBTTagCompound();
                        ote.writeToNBT( data );
                        nte.readFromNBT( (NBTTagCompound) data.copy() );
                        world.setTileEntity( i + rel_x, j + rel_y, k + rel_z, nte );
                      }
                      world.markBlockForUpdate( i + rel_x, j + rel_y, k + rel_z );
                    }
View Full Code Here

  {
    NBTTagCompound c = Platform.openNbtData( is );
    NBTTagCompound o = c.getCompoundTag( "Data" );
    if ( o == null )
      o = new NBTTagCompound();
    return (NBTTagCompound) o.copy();
  }

  @Override
  public boolean onItemUse(ItemStack is, EntityPlayer player, World w, int x, int y, int z, int side, float hx, float hy, float hz)
  {
View Full Code Here

            return null;
        if (source.getItem() instanceof ItemTicket) {
            ItemStack ticket = getTicket();
            NBTTagCompound nbt = source.getTagCompound();
            if (nbt != null)
                ticket.setTagCompound((NBTTagCompound) nbt.copy());
            return ticket;
        }
        return null;
    }
View Full Code Here

        if(!curTags.hasKey("InfiTool") || !prevTags.hasKey("InfiTool"))
            return false;

        // create copies so we don't modify the original
        curTags = (NBTTagCompound) curTags.copy();
        prevTags = (NBTTagCompound) prevTags.copy();

        curTags.removeTag("Energy");
        prevTags.removeTag("Energy");
        curTags.getCompoundTag("InfiTool").removeTag("Damage");
        prevTags.getCompoundTag("InfiTool").removeTag("Damage");
View Full Code Here

            drone.writeEntityToNBT(entityTag);
            if(stackTag != null) {
                entityTag.setTag("widgets", stackTag.getTagList("widgets", 10).copy());
                entityTag.setFloat("currentAir", stackTag.getFloat("currentAir"));
                NBTTagCompound invTag = stackTag.getCompoundTag("Inventory");
                if(invTag != null) entityTag.setTag("Inventory", invTag.copy());
            }
            drone.readEntityFromNBT(entityTag);
            if(iStack.hasDisplayName()) drone.setCustomNameTag(iStack.getDisplayName());

            drone.naturallySpawned = false;
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.