Search in sources :

Example 26 with TagInt

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

the class MyPhantom 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 27 with TagInt

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

the class MyWitherSkeleton 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 28 with TagInt

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

Example 29 with TagInt

use of de.keyle.knbt.TagInt 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 30 with TagInt

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

Aggregations

TagInt (de.keyle.knbt.TagInt)98 TagCompound (de.keyle.knbt.TagCompound)57 TagByte (de.keyle.knbt.TagByte)43 ItemStack (org.bukkit.inventory.ItemStack)24 TagList (de.keyle.knbt.TagList)16 TagString (de.keyle.knbt.TagString)13 ArrayList (java.util.ArrayList)10 HashSet (java.util.HashSet)7 TagDouble (de.keyle.knbt.TagDouble)6 EquipmentSlot (de.Keyle.MyPet.api.entity.EquipmentSlot)3 TagByteArray (de.keyle.knbt.TagByteArray)2 TagFloat (de.keyle.knbt.TagFloat)2 TagIntArray (de.keyle.knbt.TagIntArray)2 TagLong (de.keyle.knbt.TagLong)2 TagShort (de.keyle.knbt.TagShort)2 List (java.util.List)2 ByteArrayTag (net.minecraft.nbt.ByteArrayTag)2 ByteTag (net.minecraft.nbt.ByteTag)2 CompoundTag (net.minecraft.nbt.CompoundTag)2 DoubleTag (net.minecraft.nbt.DoubleTag)2