Search in sources :

Example 41 with TagCompound

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

the class MyHusk 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 42 with TagCompound

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

the class MyIllusioner method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    TagCompound item = MyPetApi.getPlatformHelper().itemStackToCompund(getEquipment(EquipmentSlot.MainHand));
    info.getCompoundData().put("Weapon", item);
    return info;
}
Also used : TagCompound(de.keyle.knbt.TagCompound)

Example 43 with TagCompound

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

the class MyMagmaCube 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 44 with TagCompound

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

the class MyMule method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    if (hasChest()) {
        info.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(getChest()));
    }
    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 45 with TagCompound

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

the class MyOcelot method writeExtendedInfo.

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

Aggregations

TagCompound (de.keyle.knbt.TagCompound)141 TagInt (de.keyle.knbt.TagInt)53 TagByte (de.keyle.knbt.TagByte)49 TagList (de.keyle.knbt.TagList)47 ItemStack (org.bukkit.inventory.ItemStack)47 ArrayList (java.util.ArrayList)18 TagString (de.keyle.knbt.TagString)12 MyPetBaby (de.Keyle.MyPet.api.entity.MyPetBaby)9 InvocationTargetException (java.lang.reflect.InvocationTargetException)9 MaterialData (org.bukkit.material.MaterialData)9 EquipmentSlot (de.Keyle.MyPet.api.entity.EquipmentSlot)8 MyPetPlayer (de.Keyle.MyPet.api.player.MyPetPlayer)5 InactiveMyPet (de.Keyle.MyPet.entity.InactiveMyPet)3 TagShort (de.keyle.knbt.TagShort)3 CraftItemStack (org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack)3 CraftItemStack (org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack)3 CraftItemStack (org.bukkit.craftbukkit.v1_7_R4.inventory.CraftItemStack)3 CraftItemStack (org.bukkit.craftbukkit.v1_8_R2.inventory.CraftItemStack)3 CraftItemStack (org.bukkit.craftbukkit.v1_8_R3.inventory.CraftItemStack)3 CraftItemStack (org.bukkit.craftbukkit.v1_9_R1.inventory.CraftItemStack)3