Package com.sk89q.jnbt

Examples of com.sk89q.jnbt.ByteTag


    public Map<String, Tag> serializeItem(BaseItemStack item) {
        Map<String, Tag> data = new HashMap<String, Tag>();
        data.put("id", new ShortTag((short) item.getType()));
        data.put("Damage", new ShortTag(item.getData()));
        data.put("Count", new ByteTag((byte) item.getAmount()));
        if (!item.getEnchantments().isEmpty()) {
            List<CompoundTag> enchantmentList = new ArrayList<CompoundTag>();
            for(Map.Entry<Integer, Integer> entry : item.getEnchantments().entrySet()) {
                Map<String, Tag> enchantment = new HashMap<String, Tag>();
                enchantment.put("id", new ShortTag(entry.getKey().shortValue()));
View Full Code Here


    public List<CompoundTag> serializeInventory(BaseItemStack[] items) {
        List<CompoundTag> tags = new ArrayList<CompoundTag>();
        for (int i = 0; i < items.length; ++i) {
            if (items[i] != null) {
                Map<String, Tag> tagData = serializeItem(items[i]);
                tagData.put("Slot", new ByteTag((byte) i));
                tags.add(new CompoundTag(tagData));
            }
        }
        return tags;
    }
View Full Code Here

    }

    @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

    }

    @Override
    public CompoundTag getNbtData() {
        Map<String, Tag> values = new HashMap<String, Tag>();
        values.put("note", new ByteTag(note));
        return new CompoundTag(values);
    }
View Full Code Here

TOP

Related Classes of com.sk89q.jnbt.ByteTag

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.