catching action pack errors. Fixes #942
This commit is contained in:
1 parent
1a068cb22a
commit
47bf776d71
1 file changed
+13
@@ -1,5 +1,6 @@
|
|||||||
package carpet.mixins;
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
import carpet.fakes.ServerPlayerEntityInterface;
|
import carpet.fakes.ServerPlayerEntityInterface;
|
||||||
import carpet.helpers.EntityPlayerActionPack;
|
import carpet.helpers.EntityPlayerActionPack;
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
@@ -34,9 +35,21 @@ public abstract class ServerPlayerEntityMixin implements ServerPlayerEntityInter
|
|||||||
|
|
||||||
@Inject(method = "tick", at = @At(value = "HEAD"))
|
@Inject(method = "tick", at = @At(value = "HEAD"))
|
||||||
private void onTick(CallbackInfo ci)
|
private void onTick(CallbackInfo ci)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
actionPack.onUpdate();
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user