Package net.glowstone.util.nbt

Examples of net.glowstone.util.nbt.CompoundTag


        firework.putCompoundList("Explosions", explosions);
    }

    @Override
    void readNbt(CompoundTag tag) {
        CompoundTag firework = tag.getCompound("Fireworks");
        power = firework.getByte("Flight");

        List<CompoundTag> explosions = firework.getCompoundList("Explosions");
        for (CompoundTag explosion : explosions) {
            effects.add(GlowMetaFireworkEffect.toEffect(explosion));
        }
    }
View Full Code Here


    @Override
    void writeNbt(CompoundTag tag) {
        super.writeNbt(tag);

        if (hasColor()) {
            CompoundTag display = new CompoundTag();
            display.putInt("color", color.asRGB());
            tag.putCompound("display", display);
        }
    }
View Full Code Here

    @Override
    void readNbt(CompoundTag tag) {
        super.readNbt(tag);

        if (tag.isCompound("display")) {
            CompoundTag display = tag.getCompound("display");
            if (display.isInt("color")) {
                this.color = Color.fromRGB(display.getInt("color"));
            }
        }
    }
View Full Code Here

        list.add(new MetadataMap.Entry(MetadataIndex.AGE, 1));
        return list;
    }

    public static CompoundTag getTag() {
        CompoundTag tag = new CompoundTag();
        tag.putInt("int", 5);
        tag.putString("string", "text");
        tag.putList("list", TagType.FLOAT, Arrays.asList(1.f, 2.f, 3.f));
        tag.putCompound("compound", new CompoundTag());
        return tag;
    }
View Full Code Here

TOP

Related Classes of net.glowstone.util.nbt.CompoundTag

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.