Files
src
build.gradle
settings.gradle
Code
9 492
src/main/java/com/esramc/nexwelcoms/NexWelcoms.java
package com.esramc.nexwelcoms;
import com.esramc.nexwelcoms.command.NexWelcomsCommand;
import com.esramc.nexwelcoms.listener.WelcomeListener;
import com.esramc.nexwelcoms.welcome.WelcomeManager;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class NexWelcoms extends JavaPlugin {
private WelcomeManager welcomeManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.welcomeManager = new WelcomeManager(this);
Bukkit.getPluginManager().registerEvents(new WelcomeListener(this), this);
NexWelcomsCommand command = new NexWelcomsCommand(this);
PluginCommand pluginCommand = getCommand("nexwelcoms");
if (pluginCommand != null) {
pluginCommand.setExecutor(command);
pluginCommand.setTabCompleter(command);
}
}
@Override
public void onDisable() {
if (welcomeManager != null) {
welcomeManager.cancelAll();
}
}
public WelcomeManager getWelcomeManager() {
return welcomeManager;
}
public void reloadPluginConfiguration() {
reloadConfig();
welcomeManager.reload();
}
}