Files
src
build.gradle
Code
29 2,046
src/main/java/com/phoenixcrates/PhoenixCrates.java
package com.phoenixcrates;
import com.phoenixcrates.commands.CrateCommand;
import com.phoenixcrates.inventory.gui.GUIListener;
import com.phoenixcrates.inventory.gui.GUIManager;
import com.phoenixcrates.listeners.BlockListener;
import com.phoenixcrates.managers.AnimationManager;
import com.phoenixcrates.managers.BlockManager;
import com.phoenixcrates.managers.ConfigManager;
import com.phoenixcrates.managers.CrateManager;
import com.phoenixcrates.managers.HologramManager;
import com.phoenixcrates.managers.KeyManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class PhoenixCrates extends JavaPlugin {
private ConfigManager configManager;
private CrateManager crateManager;
private KeyManager keyManager;
private AnimationManager animationManager;
private BlockManager blockManager;
private HologramManager hologramManager;
private GUIManager guiManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.crateManager = new CrateManager(this);
this.keyManager = new KeyManager(this);
this.blockManager = new BlockManager(this);
this.hologramManager = new HologramManager(this);
this.guiManager = new GUIManager();
this.animationManager = new AnimationManager(this);
getCommand("crate").setExecutor(new CrateCommand(this));
getCommand("crate").setTabCompleter(new CrateCommand(this));
getServer().getPluginManager().registerEvents(new BlockListener(this), this);
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
hologramManager.updateAll();
getLogger().info("PhoenixCrates has been enabled!");
}
@Override
public void onDisable() {
if (hologramManager != null) {
hologramManager.removeAll();
}
if (blockManager != null) {
blockManager.saveData();
}
getLogger().info("PhoenixCrates has been disabled!");
}
}