Package com.sk89q.jnbt

Examples of com.sk89q.jnbt.Tag


            return;
        }

        Map<String, Tag> values = rootTag.getValue();

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

        StringTag mobTypeTag;
View Full Code Here


            return;
        }

        Map<String, Tag> values = rootTag.getValue();

        Tag t;

        t = values.get("id");
        if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Skull")) {
            throw new RuntimeException("'Skull' tile entity expected");
        }
View Full Code Here

        }

        try {
            Map<String, Tag> values = rootTag.getValue();

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

                return;
            }

            Map<String, Tag> values = rootTag.getValue();

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

            List<CompoundTag> items = new ArrayList<CompoundTag>();
View Full Code Here

            return;
        }

        Map<String, Tag> values = rootTag.getValue();

        Tag t;

        text = new String[] { "", "", "", "" };

        t = values.get("id");
        if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Sign")) {
View Full Code Here

            return;
        }
       
        Map<String, Tag> values = rootTag.getValue();

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

        List<CompoundTag> items = new ArrayList<CompoundTag>();
View Full Code Here

            return;
        }

        Map<String, Tag> values = rootTag.getValue();

        Tag t;

        t = values.get("id");
        if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Music")) {
            throw new RuntimeException("'Music' tile entity expected");
        }
View Full Code Here

    public CompoundTag getChunkTag(Vector2D position, World world) throws DataException, IOException {
        McRegionReader reader = getReader(position, world.getName());

        InputStream stream = reader.getChunkInputStream(position);
        NBTInputStream nbt = new NBTInputStream(stream);
        Tag tag;

        try {
            tag = nbt.readNamedTag().getTag();
            if (!(tag instanceof CompoundTag)) {
                throw new ChunkStoreException("CompoundTag expected for chunk; got " + tag.getClass().getName());
            }

            Map<String, Tag> children = ((CompoundTag) tag).getValue();
            CompoundTag rootTag = null;
View Full Code Here

    public String getNbtId() {
        CompoundTag nbtData = getNbtData();
        if (nbtData == null) {
            return "";
        }
        Tag idTag = nbtData.getValue().get("id");
        if (idTag != null && idTag instanceof StringTag) {
            return ((StringTag) idTag).getValue();
        } else {
            return "";
        }
View Full Code Here

                + "." + Integer.toString(z, 36) + ".dat";

        InputStream stream = getInputStream(folder1, folder2, filename);
        NBTInputStream nbt = new NBTInputStream(
                new GZIPInputStream(stream));
        Tag tag;

        try {
            tag = nbt.readNamedTag().getTag();
            if (!(tag instanceof CompoundTag)) {
                throw new ChunkStoreException("CompoundTag expected for chunk; got "
                        + tag.getClass().getName());
            }

            Map<String, Tag> children = ((CompoundTag) tag).getValue();
            CompoundTag rootTag = null;
View Full Code Here

TOP

Related Classes of com.sk89q.jnbt.Tag

Copyright © 2018 www.massapicom. 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.