23 lines
811 B
Java
23 lines
811 B
Java
package wtf.hak.survivalfabric.commands;
|
|
|
|
import com.mojang.brigadier.CommandDispatcher;
|
|
import com.mojang.brigadier.context.CommandContext;
|
|
import net.minecraft.server.command.CommandManager;
|
|
import net.minecraft.server.command.ServerCommandSource;
|
|
import wtf.hak.survivalfabric.config.ConfigManager;
|
|
|
|
public class ReloadConfigCommand {
|
|
|
|
public static void register(CommandDispatcher<ServerCommandSource> dispatcher, String... aliases) {
|
|
for (String str : aliases)
|
|
dispatcher.register(CommandManager.literal(str)
|
|
.requires(source -> source.hasPermissionLevel(2))
|
|
.executes(ReloadConfigCommand::execute));
|
|
}
|
|
|
|
private static int execute(CommandContext<ServerCommandSource> context) {
|
|
ConfigManager.load();
|
|
return 1;
|
|
}
|
|
}
|