Improves code structure, and performs some necessary work for commands

This commit is contained in:
2022-08-08 14:14:42 +02:00
parent c557d969b7
commit cc39f8879a
12 changed files with 393 additions and 177 deletions

View File

@ -2,8 +2,14 @@ package net.knarcraft.blacksmith;
import net.citizensnpcs.api.CitizensAPI;
import net.knarcraft.blacksmith.command.BlackSmithCommand;
import net.knarcraft.blacksmith.command.BlackSmithTabCompleter;
import net.knarcraft.blacksmith.config.GlobalSettings;
import net.knarcraft.blacksmith.listener.NPCClickListener;
import net.knarcraft.blacksmith.listener.PlayerListener;
import net.knarcraft.blacksmith.manager.EconomyManager;
import net.knarcraft.blacksmith.trait.BlacksmithTrait;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.logging.Level;
@ -69,8 +75,13 @@ public class BlacksmithPlugin extends JavaPlugin {
PluginCommand blacksmithCommand = this.getCommand("blacksmith");
if (blacksmithCommand != null) {
blacksmithCommand.setExecutor(new BlackSmithCommand());
blacksmithCommand.setTabCompleter(new BlackSmithTabCompleter());
}
PluginManager pluginManager = getServer().getPluginManager();
pluginManager.registerEvents(new PlayerListener(), this);
pluginManager.registerEvents(new NPCClickListener(), this);
getLogger().log(Level.INFO, " v" + getDescription().getVersion() + " enabled.");
}