use of de.keyle.knbt.TagCompound in project MyPet by xXKeyleXx.
the class MyStray method readExtendedInfo.
@SuppressWarnings("unchecked")
@Override
public void readExtendedInfo(TagCompound info) {
if (info.containsKey("Equipment")) {
TagList equipment = info.getAs("Equipment", TagList.class);
List<TagBase> equipmentList = (List<TagBase>) equipment.getData();
for (TagBase tag : equipmentList) {
if (tag instanceof TagCompound) {
TagCompound item = (TagCompound) tag;
try {
ItemStack itemStack = MyPetApi.getPlatformHelper().compundToItemStack(item);
setEquipment(EquipmentSlot.getSlotById(item.getAs("Slot", TagInt.class).getIntData()), itemStack);
} catch (Exception e) {
MyPetApi.getLogger().warning("Could not load Equipment item from pet data!");
}
}
}
}
}
use of de.keyle.knbt.TagCompound in project MyPet by xXKeyleXx.
the class MyTraderLlama method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Variant", new TagInt(getVariant()));
info.getCompoundData().put("Baby", new TagByte(isBaby()));
if (hasChest()) {
info.getCompoundData().put("Chest", MyPetApi.getPlatformHelper().itemStackToCompund(getChest()));
}
if (hasDecor()) {
info.getCompoundData().put("Decor", MyPetApi.getPlatformHelper().itemStackToCompund(getDecor()));
}
return info;
}
use of de.keyle.knbt.TagCompound in project MyPet by xXKeyleXx.
the class MyTurtle method writeExtendedInfo.
@Override
public TagCompound writeExtendedInfo() {
TagCompound info = super.writeExtendedInfo();
info.getCompoundData().put("Baby", new TagByte(isBaby()));
return info;
}
use of de.keyle.knbt.TagCompound 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("VillagerType", new TagInt(getType().ordinal()));
info.getCompoundData().put("VillagerLevel", new TagInt(getVillagerLevel()));
info.getCompoundData().put("Baby", new TagByte(isBaby()));
if (originalData != null) {
info.getCompoundData().put("OriginalData", originalData);
}
return info;
}
use of de.keyle.knbt.TagCompound in project MyPet by xXKeyleXx.
the class MyStrider 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;
}
Aggregations