Files
gradle
src
build.gradle.kts
gradle.properties
gradlew
gradlew.bat
README.md
settings.gradle.kts
Code
25 1,278
src/main/java/me/customtpa/CustomTPA.java
package me.customtpa;
import me.customtpa.command.CommandManager;
import me.customtpa.config.ConfigManager;
import me.customtpa.listener.PlayerListener;
import me.customtpa.message.MessageManager;
import me.customtpa.request.RequestManager;
import me.customtpa.teleport.TeleportManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Main entry point for the CustomTPA plugin.
*/
public final class CustomTPA extends JavaPlugin {
private ConfigManager configManager;
private MessageManager messageManager;
private RequestManager requestManager;
private TeleportManager teleportManager;
/**
* Initializes managers and registers the plugin commands and events.
*/
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.messageManager = new MessageManager(this);
this.requestManager = new RequestManager(this, this.configManager, this.messageManager);
this.teleportManager = new TeleportManager(this, this.configManager, this.messageManager);
new CommandManager(this, this.configManager, this.messageManager, this.requestManager, this.teleportManager)
.registerCommands();
Bukkit.getPluginManager().registerEvents(
new PlayerListener(this.configManager, this.requestManager, this.teleportManager),
this
);
}
/**
* Cancels active tasks and clears in-memory request data during shutdown.
*/
@Override
public void onDisable() {
if (this.teleportManager != null) {
this.teleportManager.cancelAll(false);
}
if (this.requestManager != null) {
this.requestManager.clear();
}
}
}