Skip to content

Commit

Permalink
cleanup and waitable run edge case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 16, 2021
1 parent 14cfa6f commit dde3ac5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
Expand Up @@ -98,7 +98,7 @@ public static void buildCoreYamlScriptContainers(List<YamlConfiguration> yamlScr
if (yamlScripts == null) {
return;
}
Debug.log("Loading <A>" + yamlScripts.size() + "<W> scripts...");
Debug.log("Loading <A>" + yamlScripts.size() + "<W> script files...");
for (YamlConfiguration script : yamlScripts) {
for (StringHolder key : script.contents.keySet()) {
attemptLoadSingle(script.getConfigurationSection(key.str), key.str, false);
Expand Down
Expand Up @@ -127,13 +127,6 @@ public void setName(String commandName) {
name = commandName.toUpperCase();
}

@Deprecated
public AbstractCommand as(String commandName) {
setName(commandName);
DenizenCore.commandRegistry.register(this.name, this);
return this;
}

protected String name;

public String getName() {
Expand Down
Expand Up @@ -23,7 +23,7 @@ public CommandRegistry() {

public void register(String commandName, AbstractCommand commandInstance) {
this.instances.put(CoreUtilities.toLowerCase(commandName), commandInstance);
this.classes.put(((AbstractCommand) commandInstance).getClass(), CoreUtilities.toLowerCase(commandName));
this.classes.put(commandInstance.getClass(), CoreUtilities.toLowerCase(commandName));
}

public Map<String, AbstractCommand> list() {
Expand Down Expand Up @@ -138,17 +138,6 @@ public <T extends AbstractCommand> void registerCommand(Class<T> cmd) {
}
}

@Deprecated
public <T extends AbstractCommand> void registerCoreMember(Class<T> cmd, String name, String hint, int args) {
try {
cmd.newInstance().as(name).withOptions(hint, args);
}
catch (Throwable e) {
Debug.echoError("Could not register command " + name + ": " + e.getMessage());
Debug.echoError(e);
}
}

public void disableCoreMembers() {
for (AbstractCommand member : instances.values()) {
try {
Expand Down
Expand Up @@ -286,7 +286,12 @@ public final TimedQueue forceToTimed(TimedQueue.DelayTracker delay) {
newQueue.startTimeMilli = startTimeMilli;
newQueue.script = script;
newQueue.callBack(r);
newQueue.start(false);
if (newQueue.script_entries.isEmpty()) {
newQueue.stop();
}
else {
newQueue.start(false);
}
return newQueue;
}

Expand Down

0 comments on commit dde3ac5

Please sign in to comment.