f
This commit is contained in:
@@ -8,6 +8,9 @@ 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;
|
||||
|
||||
@@ -27,6 +30,12 @@ public class TrixinityEventManager extends JavaPlugin {
|
||||
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!");
|
||||
|
||||
@@ -8,12 +8,15 @@ import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.GameMode;
|
||||
|
||||
/**
|
||||
* Implementace příkazů pro správu eventů.
|
||||
*/
|
||||
public class EventCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label,
|
||||
String[] args) {
|
||||
if (args.length == 0) {
|
||||
if (args == null || args.length == 0) {
|
||||
showHelp(sender);
|
||||
return true;
|
||||
}
|
||||
@@ -49,11 +52,16 @@ public class EventCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Zobrazí nápovědu příkazů.
|
||||
*
|
||||
* @param sender Odesílatel příkazu
|
||||
*/
|
||||
private void showHelp(CommandSender sender) {
|
||||
sender.sendMessage(ChatColor.RED + ChatColor.STRIKETHROUGH.toString()
|
||||
+ "------------(" + ChatColor.RED + ChatColor.BOLD.toString()
|
||||
+ " EVENT " + ChatColor.RED + ChatColor.STRIKETHROUGH.toString()
|
||||
+ ")------------");
|
||||
sender.sendMessage(String.format("%s%s------------(%s%s EVENT %s%s)------------",
|
||||
ChatColor.RED, ChatColor.STRIKETHROUGH,
|
||||
ChatColor.RED, ChatColor.BOLD,
|
||||
ChatColor.RED, ChatColor.STRIKETHROUGH));
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + "- "
|
||||
+ ChatColor.RED + "/build off/on");
|
||||
|
||||
Reference in New Issue
Block a user