mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-01 11:36:43 +01:00
Catch exceptions from ticking spells
This commit is contained in:
parent
41e178b8d6
commit
097aa1d8cf
1 changed files with 7 additions and 1 deletions
|
@ -5,6 +5,7 @@ import java.util.stream.Stream;
|
|||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.minelittlepony.unicopia.Unicopia;
|
||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||
import com.minelittlepony.unicopia.ability.magic.SpellContainer;
|
||||
import com.minelittlepony.unicopia.ability.magic.SpellPredicate;
|
||||
|
@ -86,7 +87,12 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
|||
|
||||
@Override
|
||||
public void tick() {
|
||||
|
||||
try {
|
||||
getSpellSlot().forEach(spell -> Operation.ofBoolean(spell.tick(this, Situation.BODY)), true);
|
||||
} catch (Exception e) {
|
||||
Unicopia.LOGGER.error("Error whilst ticking spell on entity {}", getEntity(), e);
|
||||
}
|
||||
|
||||
if (invinsibilityTicks > 0) {
|
||||
invinsibilityTicks--;
|
||||
|
|
Loading…
Reference in a new issue