Search in sources :

Example 31 with TagByte

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

the class MyPigZombie 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 32 with TagByte

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

Example 33 with TagByte

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

the class MyVillager method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Profession", new TagInt(getProfession()));
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    if (originalData != null) {
        info.getCompoundData().put("OriginalData", originalData);
    }
    return info;
}
Also used : TagInt(de.keyle.knbt.TagInt) TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 34 with TagByte

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

the class MyZombie method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Baby", new TagByte(isBaby()));
    info.getCompoundData().put("Type", new TagInt(type.ordinal()));
    info.getCompoundData().put("Profession", new TagInt(profession));
    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 : TagInt(de.keyle.knbt.TagInt) ArrayList(java.util.ArrayList) EquipmentSlot(de.Keyle.MyPet.api.entity.EquipmentSlot) TagList(de.keyle.knbt.TagList) TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 35 with TagByte

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

the class Behavior method save.

@Override
public void save(TagCompound tagCompound) {
    tagCompound.getCompoundData().put("friend", new TagByte(friendlyCheckBox.isSelected()));
    tagCompound.getCompoundData().put("aggro", new TagByte(aggressiveCheckBox.isSelected()));
    tagCompound.getCompoundData().put("farm", new TagByte(farmCheckBox.isSelected()));
    tagCompound.getCompoundData().put("raid", new TagByte(raidCheckBox.isSelected()));
    tagCompound.getCompoundData().put("duel", new TagByte(duelCheckBox.isSelected()));
}
Also used : 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