Files
src
build.gradle
Code
10 495
src/main/java/com/ghostmode/GhostMode.java
package com.ghostmode;
import com.ghostmode.command.GhostCommand;
import com.ghostmode.listener.PlayerListener;
import com.ghostmode.manager.ConfigManager;
import com.ghostmode.manager.GhostManager;
import com.ghostmode.task.GhostTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class GhostMode extends JavaPlugin {
private ConfigManager configManager;
private GhostManager ghostManager;
private GhostTask ghostTask;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.ghostManager = new GhostManager();
Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
this.getCommand("ghost").setExecutor(new GhostCommand(this));
this.ghostTask = new GhostTask(this);
this.ghostTask.runTaskTimer(this, 20L, 20L);
this.getLogger().info("GhostMode has been enabled!");
}
@Override
public void onDisable() {
if (this.ghostTask != null) {
this.ghostTask.cancel();
}
this.getLogger().info("GhostMode has been disabled!");
}
}