Search in sources :

Example 56 with TagByte

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

the class MyWither method writeExtendedInfo.

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

Example 57 with TagByte

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

the class MyWolf method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    info.getCompoundData().put("Tamed", new TagByte(isTamed()));
    info.getCompoundData().put("Angry", new TagByte(isAngry()));
    info.getCompoundData().put("CollarColor", new TagByte(getCollarColor().getDyeData()));
    return info;
}
Also used : TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 58 with TagByte

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

the class MyZombieHorse method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    if (hasSaddle()) {
        info.getCompoundData().put("Saddle", MyPetApi.getPlatformHelper().itemStackToCompund(getSaddle()));
    }
    return info;
}
Also used : TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 59 with TagByte

use of de.keyle.knbt.TagByte 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 TagByte

use of de.keyle.knbt.TagByte 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

TagByte (de.keyle.knbt.TagByte)75 TagCompound (de.keyle.knbt.TagCompound)43 TagInt (de.keyle.knbt.TagInt)36 TagList (de.keyle.knbt.TagList)13 ArrayList (java.util.ArrayList)13 ItemStack (org.bukkit.inventory.ItemStack)7 EquipmentSlot (de.Keyle.MyPet.api.entity.EquipmentSlot)4 TagDouble (de.keyle.knbt.TagDouble)1 TagString (de.keyle.knbt.TagString)1 CraftItemStack (org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_11_R1.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack)1 CraftItemStack (org.bukkit.craftbukkit.v1_9_R2.inventory.CraftItemStack)1