Files
src
build.gradle
manifest.kod
Code
9 686
src/main/java/com/morphwatch/MorphWatch.java
package com.morphwatch;
import com.morphwatch.command.MorphWatchCommand;
import com.morphwatch.gui.PlayerSelectorGUI;
import com.morphwatch.listener.WatchListener;
import lombok.Getter;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public final class MorphWatch extends JavaPlugin {
private DisguiseManager disguiseManager;
private PlayerSelectorGUI playerSelectorGUI;
private FileConfiguration messages;
@Override
public void onEnable() {
saveDefaultConfig();
this.messages = getConfig();
this.disguiseManager = new DisguiseManager(this);
this.playerSelectorGUI = new PlayerSelectorGUI(this);
getServer().getPluginManager().registerEvents(new WatchListener(this), this);
getCommand("morphwatch").setExecutor(new MorphWatchCommand(this));
getLogger().info("MorphWatch enabled!");
}
@Override
public void onDisable() {
if (disguiseManager != null) {
disguiseManager.removeAll();
}
getLogger().info("MorphWatch disabled!");
}
public String msg(String key) {
return getConfig().getString("messages." + key, "&cMessage not found: " + key);
}
public void reload() {
reloadConfig();
this.messages = getConfig();
}
}