Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a23f5daa17 | |||
| d5bb520e5e | |||
| 2ebdb733c0 | |||
| 6fffb62fba | |||
| 74849724ec | |||
| c077231c6b | |||
| 741494eb70 |
+3
-3
@@ -3,8 +3,8 @@ import java.text.SimpleDateFormat
|
||||
|
||||
plugins {
|
||||
id 'checkstyle'
|
||||
id "com.github.spotbugs" version "6.2.1"
|
||||
id 'com.gradleup.shadow' version '8.3.8'
|
||||
id "com.github.spotbugs" version "6.2.2"
|
||||
id 'com.gradleup.shadow' version '9.2.2'
|
||||
id 'java'
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ dependencies {
|
||||
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.9.3'
|
||||
testImplementation 'io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter:5.13.1'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.13.1'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.13.3'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -33,6 +33,14 @@ public class EventCommand implements CommandExecutor, TabCompleter {
|
||||
String subCommand = args[0].toLowerCase();
|
||||
|
||||
switch (subCommand) {
|
||||
case "pripravuje":
|
||||
if (!sender.hasPermission("trixinity.event.admin")) {
|
||||
sender.sendMessage(ChatColor.RED + "Nemáš oprávnění k použití tohoto příkazu!");
|
||||
return true;
|
||||
}
|
||||
handleEventPripravuje(sender);
|
||||
break;
|
||||
|
||||
case "starting":
|
||||
if (!sender.hasPermission("trixinity.event.admin")) {
|
||||
sender.sendMessage(ChatColor.RED + "Nemáš oprávnění k použití tohoto příkazu!");
|
||||
@@ -118,7 +126,7 @@ public class EventCommand implements CommandExecutor, TabCompleter {
|
||||
List<String> completions = new ArrayList<>();
|
||||
|
||||
if (args.length == 1) {
|
||||
List<String> subCommands = Arrays.asList("starting", "start", "end", "build", "pvp", "kick", "event");
|
||||
List<String> subCommands = Arrays.asList("pripravuje", "starting", "start", "end", "build", "pvp", "kick", "event");
|
||||
for (String subCommand : subCommands) {
|
||||
if (subCommand.toLowerCase().startsWith(args[0].toLowerCase())) {
|
||||
completions.add(subCommand);
|
||||
@@ -206,11 +214,26 @@ public class EventCommand implements CommandExecutor, TabCompleter {
|
||||
Bukkit.broadcastMessage(ChatColor.RED + ChatColor.BOLD.toString() + "SPLEEF EVENT SKONČIL!");
|
||||
}
|
||||
|
||||
private void handleEventPripravuje(CommandSender sender) {
|
||||
TrixinityEvent plugin = TrixinityEvent.getInstance();
|
||||
|
||||
// Nastavení stavu v paměti
|
||||
plugin.setEventStatus("Připravuje se");
|
||||
|
||||
// Vypnutí whitelistu
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "whitelist off");
|
||||
|
||||
sender.sendMessage(ChatColor.BLUE + "Event se připravuje");
|
||||
|
||||
// Oznámení všem hráčům
|
||||
Bukkit.broadcastMessage(ChatColor.BLUE + ChatColor.BOLD.toString() + "EVENT SE PŘIPRAVUJE!");
|
||||
}
|
||||
|
||||
private void handleEventStarting(CommandSender sender) {
|
||||
TrixinityEvent plugin = TrixinityEvent.getInstance();
|
||||
|
||||
// Nastavenie stavu len v pamäti
|
||||
plugin.setEventStatus("Začíná"); // Už je správně
|
||||
plugin.setEventStatus("Začíná");
|
||||
|
||||
// Vyplnění oblasti vzduchem
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "fill 47 62 42 39 60 42 air");
|
||||
@@ -225,7 +248,7 @@ public class EventCommand implements CommandExecutor, TabCompleter {
|
||||
TrixinityEvent plugin = TrixinityEvent.getInstance();
|
||||
|
||||
// Nastavenie stavu len v pamäti
|
||||
plugin.setEventStatus("Začal"); // Změněno z "začal" na "Začal"
|
||||
plugin.setEventStatus("Začal");
|
||||
|
||||
// Zapnutie whitelistu
|
||||
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "whitelist on");
|
||||
|
||||
@@ -41,8 +41,21 @@ public class TrixinityPlaceholderExpansion extends PlaceholderExpansion {
|
||||
public @Nullable String onRequest(OfflinePlayer player, @NotNull String params) {
|
||||
// Zpracování různých placeholderů
|
||||
switch (params.toLowerCase()) {
|
||||
case "status": // Změněno z "trixinity_status"
|
||||
return plugin.getEventStatus();
|
||||
case "status":
|
||||
case "event_status":
|
||||
String eventStatus = plugin.getEventStatus();
|
||||
switch (eventStatus.toLowerCase()) {
|
||||
case "připravuje se":
|
||||
return "Připravuje se";
|
||||
case "začíná":
|
||||
return "Začíná";
|
||||
case "začal":
|
||||
return "Začal";
|
||||
case "skončil":
|
||||
return "Skončil";
|
||||
default:
|
||||
return eventStatus;
|
||||
}
|
||||
case "eventer":
|
||||
case "current_eventer":
|
||||
String eventer = plugin.getConfig().getString("current_eventer");
|
||||
|
||||
Reference in New Issue
Block a user