mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 02:34:10 +00:00
null check
This commit is contained in:
1 parent
35c8ce29f9
commit
b34fb1a226
1 file changed
+4
-3
@@ -51,14 +51,15 @@ public class ConditionalAction extends Action implements IConditionalAction {
|
||||
if (ticksExisted % updateEveryXTick == 0) {
|
||||
checkCount++;
|
||||
boolean terminated = terminateWhen != null && terminateWhen.get();
|
||||
if (terminated && onTermination != null) {
|
||||
if (terminated && onTermination != null)
|
||||
onTermination.accept(this);
|
||||
}
|
||||
|
||||
if ((maxChecks >= 0 && checkCount > maxChecks) || terminated) {
|
||||
markDone();
|
||||
return;
|
||||
}
|
||||
if (condition.get()) {
|
||||
|
||||
if (condition != null && condition.get()) {
|
||||
task.accept(this);
|
||||
taskExecuted = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user