Refactor bootstrap procedure, use enum for command loading

This commit is contained in:
William committed 2022-08-09 14:18:48 +01:00
1 parent eff21a16d5
commit ec1c0b744f
42 files changed
+982 -718

No files matched your search

@@ -0,0 +1,26 @@
package net.william278.huskhomes.command;
import net.william278.huskhomes.BukkitHuskHomes;
import org.jetbrains.annotations.NotNull;
/**
* Commands available on the Bukkit HuskHomes implementation
*/
public enum BukkitCommandType {
HOME_COMMAND(new HomeCommand(BukkitHuskHomes.getInstance())),
SET_HOME_COMMAND(new SetHomeCommand(BukkitHuskHomes.getInstance())),
HOME_LIST_COMMAND(new HomeListCommand(BukkitHuskHomes.getInstance())),
DEL_HOME_COMMAND(new DelHomeCommand(BukkitHuskHomes.getInstance())),
WARP_COMMAND(new WarpCommand(BukkitHuskHomes.getInstance())),
SET_WARP_COMMAND(new SetWarpCommand(BukkitHuskHomes.getInstance())),
WARP_LIST_COMMAND(new WarpListCommand(BukkitHuskHomes.getInstance())),
DEL_WARP_COMMAND(new DelWarpCommand(BukkitHuskHomes.getInstance())),
BACK_COMMAND(new BackCommand(BukkitHuskHomes.getInstance()));
public final CommandBase commandBase;
BukkitCommandType(@NotNull CommandBase commandBase) {
this.commandBase = commandBase;
}
}