Let's fix the crash, round two!

This commit is contained in:
Sollace 2019-03-12 22:29:19 +02:00
parent cd8d244ea7
commit 935dde77b1

View file

@ -1,6 +1,7 @@
package com.minelittlepony.unicopia.player;
import com.minelittlepony.unicopia.Race;
import com.minelittlepony.unicopia.entity.IMagicals;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
@ -32,10 +33,8 @@ class Hooks {
@SubscribeEvent
public static void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
IRaceContainer<?> caster = PlayerSpeciesList.instance().getEntity(event.getEntityLiving());
if (caster != null) {
caster.onUpdate();
if (!(event.getEntityLiving() instanceof IMagicals)) {
PlayerSpeciesList.instance().getEntity(event.getEntityLiving()).onUpdate();
}
}