Files
src
build.gradle
settings.gradle
Code
8 516
src/main/java/com/sphere/SpherePlugin.java
package com.sphere;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class SpherePlugin extends JavaPlugin {
private AbilityManager abilityManager;
@Override
public void onEnable() {
SpearManager spearManager = new SpearManager(this);
abilityManager = new AbilityManager(this, spearManager);
getServer().getPluginManager().registerEvents(abilityManager, this);
SphereCommand command = new SphereCommand(spearManager, abilityManager);
PluginCommand weapons = getCommand("weapons");
PluginCommand ability = getCommand("ability");
if (weapons != null) {
weapons.setExecutor(command);
}
if (ability != null) {
ability.setExecutor(command);
}
getServer().getScheduler().runTaskTimer(this, abilityManager::tickHoldingParticles, 0L, 5L);
}
@Override
public void onDisable() {
if (abilityManager != null) {
abilityManager.shutdown();
}
}
}