Files
src
build.gradle
Code
7 374
src/main/java/com/example/onevone/OneVOnePlugin.java
package com.example.onevone;
import com.example.onevone.command.OneVOneCommand;
import com.example.onevone.manager.QueueManager;
import com.example.onevone.util.SafeLocationFinder;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class OneVOnePlugin extends JavaPlugin {
private QueueManager queueManager;
private SafeLocationFinder locationFinder;
@Override
public void onEnable() {
saveDefaultConfig();
this.locationFinder = new SafeLocationFinder(this);
this.queueManager = new QueueManager(this);
getCommand("1v1").setExecutor(new OneVOneCommand(this));
getLogger().info("OneVOne plugin enabled!");
}
@Override
public void onDisable() {
if (queueManager != null) {
queueManager.clearQueue();
}
getLogger().info("OneVOne plugin disabled!");
}
public String getMessage(String path) {
return getConfig().getString("messages." + path, "&cMessage not found: " + path)
.replace("&", "§");
}
}