Prevent Action Crashing

This commit is contained in:
Kam committed 2025-05-15 20:45:22 -04:00
1 parent b34fb1a226
commit 8952963c74
3 files changed
+37 -16

No files matched your search

@@ -69,8 +69,14 @@ public class Action implements IAction {
return;
}
if (ticksExisted % updateEveryXTick == 0 && task != null) {
task.accept(this);
count++;
try {
task.accept(this);
count++;
} catch (Throwable t) {
System.err.println("Scripted action '" + name + "' threw an exception:");
t.printStackTrace();
markDone();
}
}
duration++;
}