Examples of DoubleTag


Examples of com.mojang.nbt.DoubleTag

        CompoundTag root = new CompoundTag();
       
        root.put("id", new StringTag("id", id));
       
        ListTag<DoubleTag> pos = new ListTag<DoubleTag>("Pos");
        pos.add(new DoubleTag("x", x));
        pos.add(new DoubleTag("y", y));
        pos.add(new DoubleTag("z", z));
        root.put("Pos", pos)

        ListTag<DoubleTag> motion = new ListTag<DoubleTag>("Motion");
        motion.add(new DoubleTag("dX", 0));
        motion.add(new DoubleTag("dY", 0));
        motion.add(new DoubleTag("dZ", 0));
        root.put("Motion", motion);

        ListTag<FloatTag> rotation = new ListTag<FloatTag>("Rotation");
        rotation.add(new FloatTag("yaw", 0));
        rotation.add(new FloatTag("pitch", 0));
View Full Code Here

Examples of com.sk89q.jnbt.DoubleTag

        outputStream.writeNamedTag("Schematic", schematicTag);
    }

    private Tag writeVector(Vector vector, String name) {
        List<DoubleTag> list = new ArrayList<DoubleTag>();
        list.add(new DoubleTag(vector.getX()));
        list.add(new DoubleTag(vector.getY()));
        list.add(new DoubleTag(vector.getZ()));
        return new ListTag(DoubleTag.class, list);
    }
View Full Code Here

Examples of org.jnbt.DoubleTag

        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));
        posTag.set(1, new DoubleTag("y", 120));
        posTag.set(2, new DoubleTag("z", y));
        rootMap.put("Pos", new ListTag("Pos", DoubleTag.class, posTag));
        root = new CompoundTag("Data", rootMap);
        NBTOutputStream outStream = new NBTOutputStream(new FileOutputStream(out));
        outStream.writeTag(root);
        outStream.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
     
    } 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());
        posTag.set(0, new DoubleTag("x", x));
        posTag.set(1, new DoubleTag("y", 120));
        posTag.set(2, new DoubleTag("z", y));
        rootMap.put("Player", new CompoundTag("Player", playerMap));
        playerMap.put("Pos", new ListTag("Pos", DoubleTag.class, posTag));
        root = new CompoundTag("Data", rootMap);
        HashMap<String, Tag> base = new HashMap<String, Tag>();
        base.put("Data", root);
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.