Files
src
build.gradle
settings.gradle
Code
10 564
src/main/java/com/kodari/wayfinder/WayfinderPlugin.java
package com.kodari.wayfinder;
import com.kodari.wayfinder.command.WaypointCommand;
import com.kodari.wayfinder.listener.WayfinderListener;
import com.kodari.wayfinder.manager.WaypointManager;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class WayfinderPlugin extends JavaPlugin {
private WaypointManager waypointManager;
@Override
public void onEnable() {
saveDefaultConfig();
waypointManager = new WaypointManager(this);
waypointManager.startTrackingTask();
WaypointCommand waypointCommand = new WaypointCommand(this, waypointManager);
PluginCommand command = getCommand("waypoint");
if (command != null) {
command.setExecutor(waypointCommand);
command.setTabCompleter(waypointCommand);
}
getServer().getPluginManager().registerEvents(new WayfinderListener(waypointManager), this);
}
@Override
public void onDisable() {
if (waypointManager != null) {
waypointManager.shutdown();
}
}
public WaypointManager getWaypointManager() {
return waypointManager;
}
}