Added first commands

This commit is contained in:
BuildTools committed 2020-12-11 16:19:37 +00:00
1 parent 879293237f
commit 44eef2ff30
12 files changed
+311

No files matched your search

@@ -1,5 +1,9 @@
package me.william278.huskhomes2;
import me.william278.huskhomes2.Commands.delHomeCommand;
import me.william278.huskhomes2.Commands.homeCommand;
import me.william278.huskhomes2.Commands.homeListCommand;
import me.william278.huskhomes2.Commands.setHomeCommand;
import me.william278.huskhomes2.Events.onPlayerJoin;
import me.william278.huskhomes2.Objects.Settings;
import org.bukkit.plugin.java.JavaPlugin;
@@ -20,6 +24,13 @@ public final class Main extends JavaPlugin {
plugin.getServer().getMessenger().registerIncomingPluginChannel(plugin, "BungeeCord", new pluginMessageHandler());
}
private static void registerCommands(Main plugin) {
plugin.getCommand("home").setExecutor(new homeCommand());
plugin.getCommand("sethome").setExecutor(new setHomeCommand());
plugin.getCommand("delhome").setExecutor(new delHomeCommand());
plugin.getCommand("homelist").setExecutor(new homeListCommand());
}
private static void registerEvents(Main plugin) {
plugin.getServer().getPluginManager().registerEvents(new onPlayerJoin(), plugin);
}
@@ -43,6 +54,9 @@ public final class Main extends JavaPlugin {
setupBungeeChannels(this);
}
// Register commands
registerCommands(this);
// Register events
registerEvents(this);