Examples of StringTag


Examples of com.mdimension.jchronic.tags.StringTag

  public void testToken() {
    Token token = new Token("foo");
    assertEquals(0, token.getTags().size());
    assertFalse(token.isTagged());
    token.tag(new StringTag("mytag"));
    assertEquals(1, token.getTags().size());
    assertTrue(token.isTagged());
    assertEquals(StringTag.class, token.getTag(StringTag.class).getClass());
    token.tag(new Scalar(Integer.valueOf(5)));
    assertEquals(2, token.getTags().size());
View Full Code Here

Examples of com.mojang.nbt.StringTag

            tag = new CompoundTag("Schematic");

        ShortTag tagW = new ShortTag("Width", (short)width);
        ShortTag tagH = new ShortTag("Height", (short)height);
        ShortTag tagL = new ShortTag("Length", (short)length);
        StringTag tagMat = new StringTag("Materials", "Alpha");
        ByteArrayTag tagBlockid = new ByteArrayTag("Blocks", blockid);
        ByteArrayTag tagMetadata = new ByteArrayTag("Data", metadata);

        tag.put("Width", tagW);
        tag.put("Height", tagH);
View Full Code Here

Examples of com.mojang.nbt.StringTag

        Tag temp = tag.get("id");
       
        if(temp == null || !(temp instanceof StringTag))
            throw new IllegalArgumentException("Unrecognized tag format");
       
        StringTag id = (StringTag)temp;
       
        // TODO: map into correct classes
       
        return new EntityImpl(tag);
    }
View Full Code Here

Examples of com.mojang.nbt.StringTag

        Tag temp = tag.get("id");
       
        if(temp == null || !(temp instanceof StringTag))
            throw new IllegalArgumentException("Unrecognized tag format");
       
        StringTag id = (StringTag)temp;

        // TODO: map into correct classes
       
        if(id.data.equals("Control"))
            return new CommandBlock(tag);
View Full Code Here

Examples of com.mojang.nbt.StringTag

    }
   
    public CommandBlock createCommandBlock(int x, int y, int z, String command)
    {
        CompoundTag root = createTileRoot(x, y, z, "Control");
        root.put("Command", new StringTag("Command", command));
        return new CommandBlock(root);
    }
View Full Code Here

Examples of com.mojang.nbt.StringTag

    {
        CompoundTag root = new CompoundTag();
        root.put("x", new IntTag("x", x));
        root.put("y", new IntTag("y", y));
        root.put("z", new IntTag("z", z));
        root.put("id", new StringTag("id", id));
        return root;
    }
View Full Code Here

Examples of com.mojang.nbt.StringTag

    protected CompoundTag createEntityRoot(int x, int y, int z, String id)
    {
        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));
View Full Code Here

Examples of com.sk89q.jnbt.StringTag

    }

    @Override
    public CompoundTag getNbtData() {
        Map<String, Tag> values = new HashMap<String, Tag>();
        values.put("EntityId", new StringTag(mobType));
        values.put("Delay", new ShortTag(delay));
        values.put("SpawnCount", new ShortTag(spawnCount));
        values.put("SpawnRange", new ShortTag(spawnRange));
        values.put("MinSpawnDelay", new ShortTag(minSpawnDelay));
        values.put("MaxSpawnDelay", new ShortTag(maxSpawnDelay));
View Full Code Here

Examples of com.sk89q.jnbt.StringTag

        Tag t = values.get("id");
        if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("MobSpawner")) {
            throw new RuntimeException("'MobSpawner' tile entity expected");
        }

        StringTag mobTypeTag;
        ShortTag delayTag;

        try {
            mobTypeTag = NBTUtils.getChildTag(values, "EntityId", StringTag.class);
            delayTag = NBTUtils.getChildTag(values, "Delay", ShortTag.class);
        } catch (InvalidFormatException ignored) {
            throw new RuntimeException("Invalid mob spawner data: no EntityId and/or no Delay");
        }

        this.mobType = mobTypeTag.getValue();
        this.delay = delayTag.getValue();

        ShortTag spawnCountTag = null;
        ShortTag spawnRangeTag = null;
        ShortTag minSpawnDelayTag = null;
View Full Code Here

Examples of com.sk89q.jnbt.StringTag

    @Override
    public CompoundTag getNbtData() {
        Map<String, Tag> values = new HashMap<String, Tag>();
        values.put("SkullType", new ByteTag(skullType));
        if (owner == null) owner = "";
        values.put("ExtraType", new StringTag( owner));
        values.put("Rot", new ByteTag(rot));
        return new CompoundTag(values);
    }
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.