Files
src
build.gradle
Code
22 1,741
src/main/java/com/lunarspigot/LunarPlugin.java
package com.lunarspigot;
import com.lunarspigot.commands.LunarCommand;
import com.lunarspigot.inventory.gui.GUIListener;
import com.lunarspigot.inventory.gui.GUIManager;
import com.lunarspigot.listener.PlayerListener;
import com.lunarspigot.manager.AnimationManager;
import com.lunarspigot.manager.CosmeticsManager;
import com.lunarspigot.manager.PerformanceManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class LunarPlugin extends JavaPlugin {
private GUIManager guiManager;
private AnimationManager animationManager;
private PerformanceManager performanceManager;
private CosmeticsManager cosmeticsManager;
private PlayerListener playerListenerRef;
@Override
public void onEnable() {
saveDefaultConfig();
guiManager = new GUIManager();
cosmeticsManager = new CosmeticsManager(this);
performanceManager = new PerformanceManager(this);
animationManager = new AnimationManager(this, guiManager);
playerListenerRef = new PlayerListener(this);
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getPluginManager().registerEvents(playerListenerRef, this);
LunarCommand lunarCommand = new LunarCommand(this);
if (getCommand("lunar") != null) {
getCommand("lunar").setExecutor(lunarCommand);
getCommand("lunar").setTabCompleter(lunarCommand);
}
if (getCommand("cosmetics") != null) getCommand("cosmetics").setExecutor(lunarCommand);
if (getCommand("mods") != null) getCommand("mods").setExecutor(lunarCommand);
if (getCommand("performance") != null) getCommand("performance").setExecutor(lunarCommand);
if (getCommand("launcher") != null) getCommand("launcher").setExecutor(lunarCommand);
animationManager.start();
performanceManager.start();
cosmeticsManager.start();
getLogger().info("LunarSpigot v" + getDescription().getVersion() + " enabled!");
getLogger().info("Lunar-style GUIs, cosmetics & performance HUD active.");
}
@Override
public void onDisable() {
animationManager.stop();
performanceManager.stop();
cosmeticsManager.stop();
getLogger().info("LunarSpigot disabled.");
}
}