Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 5, 2023
1 parent 42f9ad6 commit 732e505
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static <T extends ScriptContainer> T getScriptContainerAs(String name, Cl
try {
ScriptContainer container = scriptContainers.get(CoreUtilities.toLowerCase(name));
if (container != null) {
return type.cast(container);
return (T) container;
}
else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public AbstractCommand get(String commandName) {
public <T extends AbstractCommand> T get(Class<T> clazz) {
String command = classes.get(clazz);
if (command != null) {
return clazz.cast(instances.get(command));
return (T) instances.get(command);
}
else {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public ListTag runTagScript(String path, ObjectTag val, CustomObjectTag obj, Scr
return queue.determinations;
}
Debug.echoDebug(this, "[CustomObject] Grabbing parent of " + csc.getName());
csc = ScriptRegistry.getScriptContainerAs(csc.inherit, CustomScriptContainer.class);
csc = ScriptRegistry.getScriptContainer(csc.inherit);
}
Debug.echoDebug(this, "Unable to find tag handler for " + path + " for " + this.getName());
return null;
Expand All @@ -156,7 +156,7 @@ public ListTag runMechScript(String path, CustomObjectTag obj, ObjectTag value)
queue.start();
return queue.determinations;
}
csc = ScriptRegistry.getScriptContainerAs(csc.inherit, CustomScriptContainer.class);
csc = ScriptRegistry.getScriptContainer(csc.inherit);
}
return null;
}
Expand Down

0 comments on commit 732e505

Please sign in to comment.