mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 15:27:29 +00:00
IActionManager and IAction QoL
This commit is contained in:
1 parent
dd4b0c8b4b
commit
8ee35e8088
2 files changed
+18
-2
No files matched your search
@@ -115,7 +115,7 @@ public class Action implements IAction {
|
||||
|
||||
@Override
|
||||
public IAction setMaxDuration(int x) {
|
||||
this.maxDuration = x;
|
||||
this.maxDuration = Math.max(-1, x);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class Action implements IAction {
|
||||
|
||||
@Override
|
||||
public IAction setUpdateEveryXTick(int x) {
|
||||
this.updateEveryXTick = x;
|
||||
this.updateEveryXTick = Math.max(1, x);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -226,6 +226,13 @@ public class Action implements IAction {
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction start() {
|
||||
manager.start();
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction getNext() {
|
||||
boolean seenMe = false;
|
||||
|
||||
@@ -105,6 +105,15 @@ public class ScriptedActionManager implements IActionManager {
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleAction(String name, Consumer<IAction> task) {
|
||||
return scheduleAction(create(name, task));
|
||||
}
|
||||
@Override
|
||||
public IAction scheduleAction(String name, int startAfterTicks, Consumer<IAction> task) {
|
||||
return scheduleAction(create(name, startAfterTicks, task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAction scheduleAction(String name, int maxDuration, int startAfterTicks, Consumer<IAction> task) {
|
||||
return scheduleAction(create(name, maxDuration, startAfterTicks, task));
|
||||
|
||||
Reference in new issue
Block a user