Files
src
build.gradle
settings.gradle
Code
11 559
src/main/java/com/kodari/ascend/AscendPlugin.java
package com.kodari.ascend;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
public final class AscendPlugin extends JavaPlugin {
private NamespacedKey coreKey;
private NamespacedKey weaponKey;
private NamespacedKey weaponLevelKey;
private PlayerDataManager data;
private ItemFactory items;
private BossManager bossManager;
@Override
public void onEnable() {
saveDefaultConfig();
coreKey = new NamespacedKey(this, "power_core");
weaponKey = new NamespacedKey(this, "legendary_weapon");
weaponLevelKey = new NamespacedKey(this, "weapon_level");
data = new PlayerDataManager(this);
items = new ItemFactory(this);
bossManager = new BossManager(this);
AscendCommand command = new AscendCommand(this);
getCommand("ascend").setExecutor(command);
getCommand("ascend").setTabCompleter(command);
getServer().getPluginManager().registerEvents(bossManager, this);
getServer().getPluginManager().registerEvents(new AscendListener(this), this);
getLogger().info("Ascend enabled. Type /ascend to receive a random power.");
}
@Override
public void onDisable() {
if (data != null) {
data.save();
}
}
public PlayerDataManager getData() {
return data;
}
public ItemFactory getItems() {
return items;
}
public BossManager getBossManager() {
return bossManager;
}
public NamespacedKey getCoreKey() {
return coreKey;
}
public NamespacedKey getWeaponKey() {
return weaponKey;
}
public NamespacedKey getWeaponLevelKey() {
return weaponLevelKey;
}
}