Add failsafe for conjured item max damage, fixes #288

This commit is contained in:
Electroblob77
2019-12-16 13:06:32 +00:00
parent 058d83fd00
commit cfdb049368
@@ -58,6 +58,8 @@ public interface IConjuredItem {
*/
default int getMaxDamageFromNBT(ItemStack stack, Spell spell){
if(!spell.arePropertiesInitialised()) return 600; // Failsafe, some edge-cases call this during preInit
float baseDuration = spell.getProperty(SpellConjuration.ITEM_LIFETIME).floatValue();
if(stack.hasTagCompound() && stack.getTagCompound().hasKey(DURATION_MULTIPLIER_KEY)){