mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 06:07:27 +00:00
ActionManager name
This commit is contained in:
1 parent
5cb5e3da85
commit
e6d4e1f3fd
4 files changed
+22
No files matched your search
@@ -23,6 +23,7 @@ import java.util.function.Function;
|
||||
*/
|
||||
public class ActionManager implements IActionManager {
|
||||
protected boolean isWorking = false;
|
||||
protected String name = "";
|
||||
|
||||
protected final ActionQueue sequentialQueue = new ActionQueue(this, "mainSequential");
|
||||
protected final ActionQueue parallelQueue = new ActionQueue(this, "mainParallel", true);
|
||||
@@ -45,6 +46,18 @@ public class ActionManager implements IActionManager {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IActionManager setName(String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean inDebugMode() {
|
||||
return debug;
|
||||
|
||||
@@ -559,6 +559,9 @@ public class NpcAPI extends AbstractNpcAPI {
|
||||
}
|
||||
|
||||
public IActionManager getActionManager() {
|
||||
if (actionManager.getName().isEmpty())
|
||||
actionManager.setName("Global Action Manager");
|
||||
|
||||
return actionManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -1408,6 +1408,9 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
}
|
||||
|
||||
public IActionManager getActionManager() {
|
||||
if (npc.actionManager.getName().isEmpty())
|
||||
npc.actionManager.setName(String.format("%s's Action Manager", npc.getCommandSenderName()));
|
||||
|
||||
return npc.actionManager;
|
||||
}
|
||||
|
||||
|
||||
@@ -851,6 +851,9 @@ public class ScriptPlayer<T extends EntityPlayerMP> extends ScriptLivingBase<T>
|
||||
|
||||
@Override
|
||||
public IActionManager getActionManager() {
|
||||
if (data.actionManager.getName().isEmpty())
|
||||
data.actionManager.setName(String.format("%s's Action Manager", player.getDisplayName()));
|
||||
|
||||
return data.actionManager;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user