Files
src
build.gradle
Code
9 420
src/main/java/com/example/lastlocation/LastLocationPlugin.java
package com.example.lastlocation;
import com.example.lastlocation.commands.LastLocationCommand;
import com.example.lastlocation.commands.SetSlobbyCommand;
import com.example.lastlocation.listeners.PlayerListener;
import com.example.lastlocation.managers.ConfigManager;
import com.example.lastlocation.managers.DataManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class LastLocationPlugin extends JavaPlugin {
private ConfigManager configManager;
private DataManager dataManager;
@Override
public void onEnable() {
this.saveDefaultConfig();
this.configManager = new ConfigManager(this);
this.dataManager = new DataManager(this);
Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
this.getCommand("setslobby").setExecutor(new SetSlobbyCommand(this));
this.getCommand("lastlocation").setExecutor(new LastLocationCommand(this));
this.getLogger().info("LastLocation has been enabled!");
}
@Override
public void onDisable() {
if (this.dataManager != null) {
this.dataManager.saveData();
}
this.getLogger().info("LastLocation has been disabled!");
}
}