File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/dev/dfonline/codeclient/command/impl Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ public class CommandNode extends Command {
1717
1818 private static final Map <String , String > NODE_MAP = new HashMap <>();
1919
20- static {
20+ public void loadNodes () {
21+ NODE_MAP .clear ();
2122 NODE_MAP .put ("1" , "node1" );
2223 NODE_MAP .put ("2" , "node2" );
2324 NODE_MAP .put ("3" , "node3" );
@@ -52,6 +53,7 @@ public String name() {
5253 public LiteralArgumentBuilder <FabricClientCommandSource > create (LiteralArgumentBuilder <FabricClientCommandSource > cmd , CommandRegistryAccess registryAccess ) {
5354 return cmd .then (argument ("node" , word ())
5455 .suggests ((context , builder ) -> {
56+ loadNodes (); // Refresh in case of config change.
5557 NODE_MAP .keySet ().forEach (builder ::suggest );
5658 return builder .buildFuture ();
5759 })
You can’t perform that action at this time.
0 commit comments