Closed Linguardium closed 2 years ago
if(playerEntity.getActiveStatusEffects().get(StatusEffects.HEALTH_BOOST) instanceof StatusEffectInstanceAccessor instance && instance.getDuration() == 2*20)
for instance this will nullcheck and cast all at once (instanceof will nullcheck and on modern java you can create a variable of type automatically in the same line)
Fixed on 0.7.3-BETA+1.18.2
, thanks for reporting 👍🏼
https://github.com/Luligabi1/MagicFungi/blob/ee509b6c05ff6ed18d23780409e177e535069b1e/src/main/java/me/luligabi/magicfungi/mixin/PlayerEntityMixin.java#L33
if there is no instance that matches the provided HEALTH_BOOST, then it will be null and the call to getDuration will crash. do a null check