Files
src
build.gradle
settings.gradle
Code
16 810
src/main/java/com/palexo/punish/PaLexosPunish.java
package com.palexo.punish;
import com.palexo.punish.commands.PunishCommand;
import com.palexo.punish.commands.UnpunishCommand;
import com.palexo.punish.inventory.gui.GUIListener;
import com.palexo.punish.inventory.gui.GUIManager;
import com.palexo.punish.listener.LoginListener;
import com.palexo.punish.manager.PunishManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class PaLexosPunish extends JavaPlugin {
private GUIManager guiManager;
private PunishManager punishManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.guiManager = new GUIManager();
this.punishManager = new PunishManager(this);
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
Bukkit.getPluginManager().registerEvents(new LoginListener(this), this);
getCommand("punish").setExecutor(new PunishCommand(this));
getCommand("unpunish").setExecutor(new UnpunishCommand(this));
getLogger().info("PaLexo's Punish system has been enabled!");
}
@Override
public void onDisable() {
if (punishManager != null) {
punishManager.saveBans();
}
getLogger().info("PaLexo's Punish system has been disabled!");
}
}