Files
src
build.gradle
Code
19 1,657
src/main/java/com/headlife/HeadLifePlugin.java
package com.headlife;
import com.headlife.commands.HeadLifeCommand;
import com.headlife.commands.L2Command;
import com.headlife.commands.L3Command;
import com.headlife.gui.RerollGUI;
import com.headlife.listeners.DamageListener;
import com.headlife.listeners.HeadEquipListener;
import com.headlife.listeners.InteractListener;
import com.headlife.listeners.PlayerListener;
import com.headlife.managers.AbilityManager;
import com.headlife.managers.CooldownManager;
import com.headlife.managers.HeadManager;
import com.headlife.managers.PlayerDataManager;
import lombok.Getter;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class HeadLifePlugin extends JavaPlugin {
@Getter
private static HeadLifePlugin instance;
private NamespacedKey itemTypeKey;
private NamespacedKey headTypeKey;
private NamespacedKey headLevelKey;
private NamespacedKey cosmicDaggerKey;
private NamespacedKey surgeBeamKey;
private NamespacedKey originalSharpnessKey;
private NamespacedKey originalFireAspectKey;
private NamespacedKey originalEfficiencyKey;
private HeadManager headManager;
private PlayerDataManager playerDataManager;
private CooldownManager cooldownManager;
private AbilityManager abilityManager;
private RerollGUI rerollGUI;
@Override
public void onEnable() {
instance = this;
itemTypeKey = new NamespacedKey(this, "item_type");
headTypeKey = new NamespacedKey(this, "head_type");
headLevelKey = new NamespacedKey(this, "head_level");
cosmicDaggerKey = new NamespacedKey(this, "cosmic_dagger");
surgeBeamKey = new NamespacedKey(this, "surge_beam");
originalSharpnessKey = new NamespacedKey(this, "original_sharpness");
originalFireAspectKey = new NamespacedKey(this, "original_fire_aspect");
originalEfficiencyKey = new NamespacedKey(this, "original_efficiency");
headManager = new HeadManager(this);
playerDataManager = new PlayerDataManager();
cooldownManager = new CooldownManager();
abilityManager = new AbilityManager(this);
rerollGUI = new RerollGUI(this);
getCommand("headlife").setExecutor(new HeadLifeCommand(this));
getCommand("l2").setExecutor(new L2Command(this));
getCommand("l3").setExecutor(new L3Command(this));
getServer().getPluginManager().registerEvents(new DamageListener(this), this);
getServer().getPluginManager().registerEvents(new HeadEquipListener(this), this);
getServer().getPluginManager().registerEvents(new InteractListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
abilityManager.startPassiveTasks();
getLogger().info("HeadLife enabled successfully.");
}
@Override
public void onDisable() {
abilityManager.stopTasks();
getLogger().info("HeadLife disabled.");
}
}