Files
src
build.gradle
Code
16 820
src/main/java/com/acex/acexgreater/AceXGreater.java
package com.acex.acexgreater;
import com.acex.acexgreater.command.AceXCommand;
import com.acex.acexgreater.listener.JoinListener;
import com.acex.acexgreater.manager.ConfigManager;
import com.acex.acexgreater.manager.FestivalManager;
import com.acex.acexgreater.manager.PlayerDataManager;
import com.acex.acexgreater.manager.PromotionManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public final class AceXGreater extends JavaPlugin {
private ConfigManager configManager;
private PlayerDataManager playerDataManager;
private FestivalManager festivalManager;
private PromotionManager promotionManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.configManager.loadConfigs();
this.playerDataManager = new PlayerDataManager(this);
this.playerDataManager.load();
this.festivalManager = new FestivalManager(this);
this.festivalManager.startChecking();
this.promotionManager = new PromotionManager(this);
this.promotionManager.startScheduler();
getServer().getPluginManager().registerEvents(new JoinListener(this), this);
getCommand("acex").setExecutor(new AceXCommand(this));
getLogger().info("AceXGreater has been enabled!");
}
@Override
public void onDisable() {
if (this.playerDataManager != null) {
this.playerDataManager.save();
}
if (this.festivalManager != null) {
this.festivalManager.stopChecking();
}
if (this.promotionManager != null) {
this.promotionManager.stopScheduler();
}
getLogger().info("AceXGreater has been disabled!");
}
}