Files
src
build.gradle
Code
21 1,513
src/main/java/com/legacyplugin/LegacyPlugin.java
package com.legacyplugin;
import com.legacyplugin.boss.BossManager;
import com.legacyplugin.command.LegacyCommand;
import com.legacyplugin.data.DataManager;
import com.legacyplugin.inventory.gui.GUIListener;
import com.legacyplugin.inventory.gui.GUIManager;
import com.legacyplugin.legacy.LegacyManager;
import com.legacyplugin.listener.DeathListener;
import com.legacyplugin.listener.TrackingListener;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class LegacyPlugin extends JavaPlugin {
private DataManager dataManager;
private LegacyManager legacyManager;
private BossManager bossManager;
private GUIManager guiManager;
@Override
public void onEnable() {
saveDefaultConfig();
dataManager = new DataManager(this);
legacyManager = new LegacyManager(this);
bossManager = new BossManager(this);
guiManager = new GUIManager();
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getPluginManager().registerEvents(new TrackingListener(this), this);
getServer().getPluginManager().registerEvents(new DeathListener(this), this);
getServer().getPluginManager().registerEvents(bossManager, this);
LegacyCommand legacyCommand = new LegacyCommand(this);
getCommand("legacy").setExecutor(legacyCommand);
getCommand("legacy").setTabCompleter(legacyCommand);
legacyManager.startDragonEggTask();
bossManager.startAutoSpawnTask();
getLogger().info("LegacyPlugin enabled successfully.");
}
@Override
public void onDisable() {
bossManager.cleanup();
dataManager.saveAll();
getLogger().info("LegacyPlugin disabled. Data saved.");
}
}