Fixed error when attempting to update an entity that doesn't have a caster

This commit is contained in:
Sollace 2019-03-12 22:25:52 +02:00
parent 779ae10a99
commit 45965746ed

View file

@ -32,7 +32,11 @@ class Hooks {
@SubscribeEvent @SubscribeEvent
public static void onLivingUpdate(LivingEvent.LivingUpdateEvent event) { public static void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {
PlayerSpeciesList.instance().getEntity(event.getEntityLiving()).onUpdate(); IRaceContainer<?> caster = PlayerSpeciesList.instance().getEntity(event.getEntityLiving());
if (caster != null) {
caster.onUpdate();
}
} }
@SubscribeEvent @SubscribeEvent