Examples of readTag()


Examples of com.iCo6.util.nbt.NBTInputStream.readTag()

    }

    private void writeInventory(String name, ItemStack[] stacks) {
        try {
            NBTInputStream in = new NBTInputStream(new FileInputStream(new File(dataDir, name + ".dat")));
            CompoundTag tag = (CompoundTag) in.readTag();
            in.close();

            ArrayList tagList = new ArrayList<Tag>();

            for (int i = 0; i < stacks.length; ++i) {
View Full Code Here

Examples of morph.common.morph.MorphState.readTag()

        MorphState prevState = new MorphState(mc.theWorld, playerName, "", null, true);
        MorphState nextState = new MorphState(mc.theWorld, playerName, "", null, true);

        prevState.readTag(mc.theWorld, prevTag);
        nextState.readTag(mc.theWorld, nextTag);

        //TODO check for mc.theplayer morphstate
        //          prevState = MorphHandler.addOrGetMorphState(Morph.proxy.tickHandlerClient.getPlayerMorphs(event.entityPlayer.worldObj, event.entityPlayer.username), prevState);
        //          nextState = MorphHandler.addOrGetMorphState(Morph.proxy.tickHandlerClient.getPlayerMorphs(event.entityPlayer.worldObj, event.entityPlayer.username), nextState);
View Full Code Here

Examples of morph.common.morph.MorphState.readTag()

        {
            MorphState state = new MorphState(mc.theWorld, mc.thePlayer.getCommandSenderName(), "", null, true);

            if(tag != null)
            {
                state.readTag(mc.theWorld, tag);

                String name = state.entInstance.getCommandSenderName();

                if(name != null)
                {
View Full Code Here

Examples of morph.common.morph.MorphState.readTag()

        int count = tag.getInteger("morphStatesCount");
        for(int i = 0; i < count; i++)
        {
            MorphState state = new MorphState(event.player.worldObj, event.player.getCommandSenderName(), event.player.getCommandSenderName(), null, false);
            state.readTag(event.player.worldObj, tag.getCompoundTag("morphState" + i));
            if(!state.identifier.equalsIgnoreCase(""))
            {
                MorphHandler.addOrGetMorphState(list, state);
            }
        }
View Full Code Here

Examples of net.lightstone.util.nbt.NBTInputStream.readTag()

    DataInputStream in = region.getChunkDataInputStream(regionX, regionZ);
    Chunk chunk = new Chunk(x, z);

    NBTInputStream nbt = new NBTInputStream(in, false);
    CompoundTag tag = (CompoundTag) nbt.readTag();
    Map<String, Tag> levelTags = ((CompoundTag) tag.getValue().get("Level")).getValue();

    byte[] tileData = ((ByteArrayTag) levelTags.get("Blocks")).getValue();
    chunk.setTypes(tileData);
View Full Code Here

Examples of org.jnbt.NBTInputStream.readTag()

   * @author Corrodias
   */
  protected static Coordinates getSpawn(final File level) throws IOException {
    try {
      final NBTInputStream input = new NBTInputStream(new FileInputStream(level));
      final CompoundTag originalTopLevelTag = (CompoundTag) input.readTag();
      input.close();

      final Map<String, Tag> originalData =
          ((CompoundTag) originalTopLevelTag.getValue().get("Data")).getValue();
      // This is our map of data. It is an unmodifiable map, for some
View Full Code Here

Examples of org.jnbt.NBTInputStream.readTag()

   */
  protected static void setSpawn(final File level, final Coordinates xyz) throws IOException {

    try {
      final NBTInputStream input = new NBTInputStream(new FileInputStream(level));
      final CompoundTag originalTopLevelTag = (CompoundTag) input.readTag();
      input.close();

      //@formatter:off

            //Note: The Following Information is Old (from 2010), compared to the Data inside a current "level.dat".
View Full Code Here

Examples of org.jnbt.NBTInputStream.readTag()

      String outPath = file.getParent() + "/players/" + name +".dat";
      out = new File(outPath);
      backupFile(out);
      try {
        NBTInputStream inStream = new NBTInputStream(new FileInputStream(out));
        CompoundTag root = (CompoundTag)inStream.readTag();
        inStream.close();
       
        HashMap<String, Tag> rootMap = new HashMap<String, Tag>(root.getValue());
        ArrayList<Tag> posTag = new ArrayList<Tag>(((ListTag)rootMap.get("Pos")).getValue());
        posTag.set(0, new DoubleTag("x", x));
View Full Code Here

Examples of org.jnbt.NBTInputStream.readTag()

    } else {
      out = file;
      backupFile(out);
      try {
        NBTInputStream inStream = new NBTInputStream(new FileInputStream(out));
        CompoundTag root = (CompoundTag)(((CompoundTag)inStream.readTag()).getValue().get("Data"));
        inStream.close();
       
        HashMap<String, Tag> rootMap = new HashMap<String, Tag>(root.getValue());
        HashMap<String, Tag> playerMap = new HashMap<String, Tag>(((CompoundTag)rootMap.get("Player")).getValue());
        ArrayList<Tag> posTag = new ArrayList<Tag>(((ListTag)playerMap.get("Pos")).getValue());
View Full Code Here

Examples of org.jnbt.NBTInputStream.readTag()

    file = f;
    players = new ArrayList<MapObjectPlayer>();
    back = new ArrayList<String>();
    try {
      NBTInputStream inStream = new NBTInputStream(new FileInputStream(f));
      CompoundTag root = (CompoundTag) ((CompoundTag)inStream.readTag()).getValue().get("Data");
      inStream.close();
      seed = (Long)(root.getValue().get("RandomSeed").getValue());
      if (root.getValue().get("generatorName") != null) {
        genType = Type.fromMixedCase((String)(root.getValue().get("generatorName").getValue()));
       
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.