Files
src
build.gradle
settings.gradle
Code
14 813
src/main/java/com/morphplugin/MorphPlugin.java
package com.morphplugin;
import com.morphplugin.command.MorphCommand;
import com.morphplugin.command.MorphDebugCommand;
import com.morphplugin.command.MorphListCommand;
import com.morphplugin.command.UnmorphCommand;
import com.morphplugin.listener.MorphListener;
import com.morphplugin.manager.ConfigManager;
import com.morphplugin.manager.MorphManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class MorphPlugin extends JavaPlugin {
private ConfigManager configManager;
private MorphManager morphManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.morphManager = new MorphManager(this);
registerCommands();
registerListeners();
getLogger().info("Proteus has been enabled!");
}
@Override
public void onDisable() {
if (morphManager != null) {
morphManager.unmorphAll();
}
getLogger().info("Proteus has been disabled!");
}
private void registerCommands() {
getCommand("morph").setExecutor(new MorphCommand(this));
getCommand("unmorph").setExecutor(new UnmorphCommand(this));
getCommand("morphlist").setExecutor(new MorphListCommand(this));
getCommand("morphdebug").setExecutor(new MorphDebugCommand(this));
}
private void registerListeners() {
getServer().getPluginManager().registerEvents(new MorphListener(this), this);
}
}