cleanup fabric commands

This commit is contained in:
dfsek
2021-03-09 03:15:43 -07:00
parent 0f39d64d72
commit fac4cb43a8
3 changed files with 55 additions and 31 deletions

View File

@@ -8,5 +8,6 @@ public final class CommandUtil {
public static void registerAll(CommandManager manager) throws MalformedCommandException {
manager.register("structure", StructureCommand.class);
manager.register("profile", ProfileCommand.class);
manager.register("reload", ReloadCommand.class);
}
}

View File

@@ -1,13 +1,23 @@
package com.dfsek.terra.commands;
import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.command.CommandTemplate;
import com.dfsek.terra.api.command.annotation.Command;
import com.dfsek.terra.api.injection.annotations.Inject;
import com.dfsek.terra.api.platform.CommandSender;
import com.dfsek.terra.config.lang.LangUtil;
@Command()
public class ReloadCommand implements CommandTemplate {
@Inject
private TerraPlugin main;
@Override
public void execute(CommandSender sender) {
if(!main.reload()) {
LangUtil.send("command.reload-error", sender);
} else {
LangUtil.send("command.reload", sender);
}
}
}