Tough As Nails

Tough As Nails

21M Downloads

Crash when drinking Heat Resist Potion

CovertJaguar opened this issue ยท 0 comments

commented

Version 1.9.4-1.1.1.4

Drinking a Heat Resist potion results in the following client crash:

java.util.ConcurrentModificationException
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
    at java.util.HashMap$KeyIterator.next(HashMap.java:1461)
    at net.minecraft.entity.EntityLivingBase.func_70679_bo(EntityLivingBase.java:586)
    at net.minecraft.entity.EntityLivingBase.func_70030_z(EntityLivingBase.java:343)
    at net.minecraft.entity.Entity.func_70071h(Entity.java:359)
    at net.minecraft.entity.EntityLivingBase.func_70071h(EntityLivingBase.java:1932)
    at net.minecraft.entity.player.EntityPlayer.func_70071h(EntityPlayer.java:233)

It crashed on the activePotionsMap.

The potions currently modify the activePotionsMap during their performEffect() function, this is likely the cause of the crash. You'd probably be better off setting the Heat Resist/Cold Resist potions as curative items for their respective bad PotionEffects and calling EntityLivingBase.curePotionEffects() outside of performEffect so the game can handle clean up on its own terms.