use of com.viste.realisticarmortiers.data.PotionEffect in project RealisticArmorTiers by IsakViste.
the class ArmorStorage method readNBT.
@Override
public void readNBT(Capability<IArmor> capability, IArmor instance, Direction side, INBT nbt) {
NBTTagCompound bigCompoundList = (NBTTagCompound) nbt;
NBTTagList itemList = bigCompoundList.getTagList("items", net.minecraftforge.common.util.Constants.NBT.TAG_LIST);
for (int i = 0; i < itemList.tagCount(); i++) {
new ItemStack(itemList.getCompoundTagAt(i));
}
NBTTagList potionList = bigCompoundList.getTagList("setEffects", net.minecraftforge.common.util.Constants.NBT.TAG_LIST);
for (int i = 0; i < potionList.tagCount(); i++) {
new PotionEffect(potionList.getCompoundTagAt(i).getString("effect"), potionList.getCompoundTagAt(i).getInteger("efficiency"), 0);
}
NBTTagList usedPotionList = bigCompoundList.getTagList("usedSetEffects", net.minecraftforge.common.util.Constants.NBT.TAG_LIST);
for (int i = 0; i < usedPotionList.tagCount(); i++) {
new PotionEffect(usedPotionList.getCompoundTagAt(i).getString("effect"), usedPotionList.getCompoundTagAt(i).getInteger("efficiency"), usedPotionList.getCompoundTagAt(i).getInteger("duration"));
}
}
Aggregations