mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 19:59:56 +00:00
Prevent Action Crashing
This commit is contained in:
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++;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user