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.TrixinityCommand;
|
||||||
import dev.trixinity.eventmanager.commands.EventCommand;
|
import dev.trixinity.eventmanager.commands.EventCommand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hlavní třída pluginu pro správu eventů na Minecraft serveru.
|
||||||
|
*/
|
||||||
public class TrixinityEventManager extends JavaPlugin {
|
public class TrixinityEventManager extends JavaPlugin {
|
||||||
private static volatile TrixinityEventManager instance;
|
private static volatile TrixinityEventManager instance;
|
||||||
|
|
||||||
@@ -27,6 +30,12 @@ public class TrixinityEventManager extends JavaPlugin {
|
|||||||
getLogger().info("TrixinityEventManager byl vypnut!");
|
getLogger().info("TrixinityEventManager byl vypnut!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Získá instanci pluginu.
|
||||||
|
*
|
||||||
|
* @return Instance pluginu
|
||||||
|
* @throws IllegalStateException pokud plugin není inicializován
|
||||||
|
*/
|
||||||
public static TrixinityEventManager getInstance() {
|
public static TrixinityEventManager getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
throw new IllegalStateException("Plugin není inicializován!");
|
throw new IllegalStateException("Plugin není inicializován!");
|
||||||
|
|||||||
@@ -8,12 +8,15 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementace příkazů pro správu eventů.
|
||||||
|
*/
|
||||||
public class EventCommand implements CommandExecutor {
|
public class EventCommand implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label,
|
public boolean onCommand(CommandSender sender, Command command, String label,
|
||||||
String[] args) {
|
String[] args) {
|
||||||
if (args.length == 0) {
|
if (args == null || args.length == 0) {
|
||||||
showHelp(sender);
|
showHelp(sender);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -49,11 +52,16 @@ public class EventCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Zobrazí nápovědu příkazů.
|
||||||
|
*
|
||||||
|
* @param sender Odesílatel příkazu
|
||||||
|
*/
|
||||||
private void showHelp(CommandSender sender) {
|
private void showHelp(CommandSender sender) {
|
||||||
sender.sendMessage(ChatColor.RED + ChatColor.STRIKETHROUGH.toString()
|
sender.sendMessage(String.format("%s%s------------(%s%s EVENT %s%s)------------",
|
||||||
+ "------------(" + ChatColor.RED + ChatColor.BOLD.toString()
|
ChatColor.RED, ChatColor.STRIKETHROUGH,
|
||||||
+ " EVENT " + ChatColor.RED + ChatColor.STRIKETHROUGH.toString()
|
ChatColor.RED, ChatColor.BOLD,
|
||||||
+ ")------------");
|
ChatColor.RED, ChatColor.STRIKETHROUGH));
|
||||||
sender.sendMessage("");
|
sender.sendMessage("");
|
||||||
sender.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + "- "
|
sender.sendMessage(ChatColor.RED + ChatColor.BOLD.toString() + "- "
|
||||||
+ ChatColor.RED + "/build off/on");
|
+ ChatColor.RED + "/build off/on");
|
||||||
|
|||||||
Reference in New Issue
Block a user