shit, snap
This commit is contained in:
1 parent
ff5c09d7b9
commit
14d3a1725b
6 files changed
+58
-18
No files matched your search
@@ -2,6 +2,7 @@ package carpet.script;
|
||||
|
||||
import carpet.CarpetServer;
|
||||
import carpet.script.api.Auxiliary;
|
||||
import carpet.script.argument.FunctionArgument;
|
||||
import carpet.script.bundled.Module;
|
||||
import carpet.script.command.CommandArgument;
|
||||
import carpet.script.exception.CarpetExpressionException;
|
||||
@@ -161,6 +162,26 @@ public class CarpetScriptHost extends ScriptHost
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean readCommands()
|
||||
{
|
||||
Value commands = appConfig.get(StringValue.of("commands"));
|
||||
if (commands == null) return true;
|
||||
if (!(commands instanceof MapValue))
|
||||
throw new InternalExpressionException("'commands' element in config should be a map");
|
||||
for (Map.Entry<Value, Value> commandsData : ((MapValue)commands).getMap().entrySet())
|
||||
{
|
||||
String path = commandsData.getKey().getString();
|
||||
FunctionArgument<Value> funSpec = FunctionArgument.fromCommandSpec(this, commandsData.getValue());
|
||||
//if (fun)
|
||||
|
||||
//... WIP
|
||||
|
||||
//Map<String, Value> specData = ((MapValue) spec).getMap().entrySet().stream().collect(Collectors.toMap(e -> e.getKey().getString(), Map.Entry::getValue));
|
||||
//appArgTypes.put(argument, CommandArgument.buildFromConfig(argument, specData));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Module getModuleOrLibraryByName(String name)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user