use of de.keyle.knbt.TagBase in project MyPet by xXKeyleXx.
the class MyWitherSkeleton 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!");
}
}
}
}
}
Aggregations