Search in sources :

Example 46 with TagCompound

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

the class MyParrot method writeExtendedInfo.

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

Example 47 with TagCompound

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

the class MyPig method writeExtendedInfo.

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

Example 48 with TagCompound

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

the class MyGiant 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 49 with TagCompound

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

the class MyGoat method writeExtendedInfo.

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

Example 50 with TagCompound

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

the class MyPolarBear 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)

Aggregations

TagCompound (de.keyle.knbt.TagCompound)199 TagInt (de.keyle.knbt.TagInt)67 TagByte (de.keyle.knbt.TagByte)65 TagList (de.keyle.knbt.TagList)57 ItemStack (org.bukkit.inventory.ItemStack)53 ArrayList (java.util.ArrayList)27 TagString (de.keyle.knbt.TagString)24 InvocationTargetException (java.lang.reflect.InvocationTargetException)18 CompoundTag (net.minecraft.nbt.CompoundTag)12 MyPetBaby (de.Keyle.MyPet.api.entity.MyPetBaby)11 TagShort (de.keyle.knbt.TagShort)10 HashSet (java.util.HashSet)9 MaterialData (org.bukkit.material.MaterialData)9 ListTag (net.minecraft.nbt.ListTag)8 CraftItemStack (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack)6 CraftItemStack (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftItemStack)6 TagBase (de.keyle.knbt.TagBase)5 List (java.util.List)5 ItemStack (net.minecraft.world.item.ItemStack)4 WorldGroup (de.Keyle.MyPet.api.WorldGroup)3