added rule autoloadScripts to load scripts at startup.

This commit is contained in:
gnembon committed 2019-09-17 14:21:36 -03:00
1 parent 9050a8a0ef
commit b89bb3e503
3 files changed
+20 -4

No files matched your search

@@ -205,7 +205,7 @@ public class ScriptCommand
)))))))));
LiteralArgumentBuilder<ServerCommandSource> a = literal("load").requires( (player) -> player.hasPermissionLevel(2) ).
then(argument("package", StringArgumentType.word()).
suggests( (cc, bb) -> suggestMatching(CarpetServer.scriptServer.listAvailableModules(),bb)).
suggests( (cc, bb) -> suggestMatching(CarpetServer.scriptServer.listAvailableModules(true),bb)).
executes((cc) ->
{
boolean success = CarpetServer.scriptServer.addScriptHost(cc.getSource(), StringArgumentType.getString(cc, "package"), true);