mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 17:47:32 +00:00
More overloads and cleanup
This commit is contained in:
1 parent
0e8db79605
commit
67926477be
3 files changed
+21
-8
No files matched your search
@@ -89,10 +89,8 @@ public class Action implements IAction {
|
||||
executeTask();
|
||||
}
|
||||
|
||||
if (maxCount > -1 && count >= maxCount) {
|
||||
if (maxCount > -1 && count >= maxCount)
|
||||
markDone();
|
||||
return;
|
||||
}
|
||||
|
||||
duration++;
|
||||
}
|
||||
@@ -145,8 +143,8 @@ public class Action implements IAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction setMaxDuration(int x) {
|
||||
this.maxDuration = Math.max(-1, x);
|
||||
public IAction setMaxDuration(int ticks) {
|
||||
this.maxDuration = Math.max(-1, ticks);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -156,8 +154,8 @@ public class Action implements IAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction times(int x) {
|
||||
this.maxCount = Math.max(-1, x);
|
||||
public IAction times(int n) {
|
||||
this.maxCount = Math.max(-1, n);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,6 +285,21 @@ public class ActionManager implements IActionManager {
|
||||
((Action) action).isScheduled = true;
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleParallel(Consumer<IAction> task) {
|
||||
return scheduleParallel(create(task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleParallel(int delay, Consumer<IAction> task) {
|
||||
return scheduleParallel(create(delay, task));
|
||||
}
|
||||
@Override
|
||||
public IAction scheduleParallel(int maxDuration, int delay, Consumer<IAction> task) {
|
||||
return scheduleParallel(create(maxDuration, delay, task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleParallel(String name, Consumer<IAction> task) {
|
||||
return scheduleParallel(create(name, task));
|
||||
|
||||
@@ -120,7 +120,7 @@ public class ConditionalAction extends Action implements IConditionalAction {
|
||||
|
||||
@Override
|
||||
public IConditionalAction setMaxChecks(int maxChecks) {
|
||||
this.maxChecks = maxChecks;
|
||||
this.maxChecks = Math.max(-1, maxChecks);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user