diff --git a/src/main/java/carpet/mixins/ServerPlayerEntityMixin.java b/src/main/java/carpet/mixins/ServerPlayerEntityMixin.java index f29428da..24acee10 100644 --- a/src/main/java/carpet/mixins/ServerPlayerEntityMixin.java +++ b/src/main/java/carpet/mixins/ServerPlayerEntityMixin.java @@ -1,5 +1,6 @@ package carpet.mixins; +import carpet.CarpetSettings; import carpet.fakes.ServerPlayerEntityInterface; import carpet.helpers.EntityPlayerActionPack; import com.mojang.authlib.GameProfile; @@ -34,7 +35,19 @@ public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInter @Inject(method = "tick", at = @At(value = "HEAD")) private void onTick(CallbackInfo ci) { - actionPack.onUpdate(); + try + { + actionPack.onUpdate(); + } + catch (StackOverflowError soe) + { + CarpetSettings.LOG.fatal("Caused stack overflow when performing player action"); + } + catch (Throwable exc) + { + CarpetSettings.LOG.fatal("Error executing player tasks "+ exc.getMessage()); + exc.printStackTrace(); + } }