45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package dev.trixinity.eventmanager;
|
|
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
import com.sk89q.worldguard.WorldGuard;
|
|
import com.sk89q.worldguard.protection.flags.Flag;
|
|
import com.sk89q.worldguard.protection.flags.StateFlag;
|
|
import com.sk89q.worldguard.protection.flags.registry.FlagRegistry;
|
|
import dev.trixinity.eventmanager.commands.TrixinityCommand;
|
|
import dev.trixinity.eventmanager.commands.EventCommand;
|
|
|
|
/**
|
|
* Hlavní třída pluginu pro správu eventů na Minecraft serveru.
|
|
*/
|
|
public class TrixinityEventManager extends JavaPlugin {
|
|
private static volatile TrixinityEventManager instance;
|
|
|
|
@Override
|
|
public void onEnable() {
|
|
instance = this;
|
|
|
|
// Registrace příkazů
|
|
getCommand("trixinity").setExecutor(new TrixinityCommand());
|
|
getCommand("event").setExecutor(new EventCommand());
|
|
|
|
getLogger().info("TrixinityEventManager byl úspěšně spuštěn!");
|
|
}
|
|
|
|
@Override
|
|
public void onDisable() {
|
|
getLogger().info("TrixinityEventManager byl vypnut!");
|
|
}
|
|
|
|
/**
|
|
* Získá instanci pluginu.
|
|
*
|
|
* @return Instance pluginu
|
|
* @throws IllegalStateException pokud plugin není inicializován
|
|
*/
|
|
public static TrixinityEventManager getInstance() {
|
|
if (instance == null) {
|
|
throw new IllegalStateException("Plugin není inicializován!");
|
|
}
|
|
return instance;
|
|
}
|
|
} |