Search in sources :

Example 21 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)

Example 22 with TagByte

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

the class CustomInventory method save.

public TagCompound save(TagCompound compound) {
    List<TagCompound> itemList = new ArrayList<>();
    for (int i = 0; i < this.items.size(); i++) {
        ItemStack itemStack = this.items.get(i);
        if (itemStack != null) {
            TagCompound item = ItemStackNBTConverter.itemStackToCompund(itemStack);
            item.getCompoundData().put("Slot", new TagByte((byte) i));
            itemList.add(item);
        }
    }
    compound.getCompoundData().put("Items", new TagList(itemList));
    return compound;
}
Also used : ArrayList(java.util.ArrayList) TagList(de.keyle.knbt.TagList) CraftItemStack(org.bukkit.craftbukkit.v1_10_R1.inventory.CraftItemStack) TagCompound(de.keyle.knbt.TagCompound) TagByte(de.keyle.knbt.TagByte)

Example 23 with TagByte

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

the class MyChicken 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 24 with TagByte

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

the class MyCow 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 25 with TagByte

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

the class MyCreeper method writeExtendedInfo.

@Override
public TagCompound writeExtendedInfo() {
    TagCompound info = super.writeExtendedInfo();
    info.getCompoundData().put("Powered", new TagByte(isPowered()));
    return info;
}
Also used : TagCompound(de.keyle.knbt.TagCompound) 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