Merge branch 'master' into 1.17

This commit is contained in:
gnembon committed 2020-11-11 16:08:30 -04:00
commit 769e38021c
9 files changed
+61 -21

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)
{