Search in sources :

Example 56 with TagInt

use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.

the class MyLlama method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Variant", new TagInt(getVariant()));
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    if (hasChest()) {
        info.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(getChest()));
    }
    if (hasDecor()) {
        info.getCompoundData().put("Decor", MyPetApi.getPlatformHelper().itemStackToCompund(getDecor()));
    }
    return info;
}
Also used : TagInt(de.keyle.knbt.TagInt) TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 57 with TagInt

use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.

the class MySlime method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Size", new TagInt(getSize()));
    return info;
}
Also used : TagInt(de.keyle.knbt.TagInt) TagCompound(de.keyle.knbt.TagCompound)

Example 58 with TagInt

use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.

the class MyStray method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    List<TagCompound> itemList = new ArrayList<>();
    for (EquipmentSlot slot : EquipmentSlot.values()) {
        if (getEquipment(slot) != null) {
            TagCompound item = MyPetApi.getPlatformHelper().itemStackToCompund(getEquipment(slot));
            item.getCompoundData().put("Slot", new TagInt(slot.getSlotId()));
            itemList.add(item);
        }
    }
    info.getCompoundData().put("Equipment", new TagList(itemList));
    return info;
}
Also used : ArrayList(java.util.ArrayList) EquipmentSlot(de.Keyle.MyPet.api.entity.EquipmentSlot) TagInt(de.keyle.knbt.TagInt) TagList(de.keyle.knbt.TagList) TagCompound(de.keyle.knbt.TagCompound)

Example 59 with TagInt

use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.

the class MyZombieVillager method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    List<TagCompound> itemList = new ArrayList<>();
    for (EquipmentSlot slot : EquipmentSlot.values()) {
        if (getEquipment(slot) != null) {
            TagCompound item = MyPetApi.getPlatformHelper().itemStackToCompund(getEquipment(slot));
            item.getCompoundData().put("Slot", new TagInt(slot.getSlotId()));
            itemList.add(item);
        }
    }
    info.getCompoundData().put("Equipment", new TagList(itemList));
    return info;
}
Also used : ArrayList(java.util.ArrayList) EquipmentSlot(de.Keyle.MyPet.api.entity.EquipmentSlot) TagInt(de.keyle.knbt.TagInt) TagList(de.keyle.knbt.TagList) TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 60 with TagInt

use of de.keyle.knbt.TagInt in project MyPet by xXKeyleXx.

the class EntityConverterService method convertSheep.

public void convertSheep(Sheep sheep, TagCompound properties) {
    properties.getCompoundData().put("Color", new TagInt(sheep.getColor().getDyeData()));
    properties.getCompoundData().put("Sheared", new TagByte(sheep.isSheared()));
}
Also used : TagInt(de.keyle.knbt.TagInt) TagByte(de.keyle.knbt.TagByte)

Aggregations

TagInt (de.keyle.knbt.TagInt)75 TagCompound (de.keyle.knbt.TagCompound)42 TagByte (de.keyle.knbt.TagByte)36 ItemStack (org.bukkit.inventory.ItemStack)20 TagList (de.keyle.knbt.TagList)17 TagString (de.keyle.knbt.TagString)10 EquipmentSlot (de.Keyle.MyPet.api.entity.EquipmentSlot)8 ArrayList (java.util.ArrayList)8 TagDouble (de.keyle.knbt.TagDouble)4