Files
src
build.gradle
Code
8 552
src/main/java/com/eclipse/smp/EclipseSMP.java
package com.eclipse.smp;
import com.eclipse.smp.command.PowerCommand;
import com.eclipse.smp.listener.PowerListener;
import com.eclipse.smp.manager.PowerManager;
import com.eclipse.smp.task.ActionBarTask;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public final class EclipseSMP extends JavaPlugin {
private PowerManager powerManager;
private ActionBarTask actionBarTask;
@Override
public void onEnable() {
this.powerManager = new PowerManager(this);
this.powerManager.loadData();
getServer().getPluginManager().registerEvents(new PowerListener(this), this);
getCommand("eclipsesmp").setExecutor(new PowerCommand(this));
this.actionBarTask = new ActionBarTask(this);
this.actionBarTask.start();
getLogger().info("EclipseSMP has been enabled!");
}
@Override
public void onDisable() {
if (actionBarTask != null) {
actionBarTask.stop();
}
if (powerManager != null) {
powerManager.saveData();
}
getLogger().info("EclipseSMP has been disabled!");
}
}