diff --git a/src/main/java/de/fanta/challenges/Timer.java b/src/main/java/de/fanta/challenges/Timer.java index c258323..5604d9c 100644 --- a/src/main/java/de/fanta/challenges/Timer.java +++ b/src/main/java/de/fanta/challenges/Timer.java @@ -59,10 +59,10 @@ } else { for (Player p : Bukkit.getOnlinePlayers()) { p.setGameMode(GameMode.SPECTATOR); - p.sendTitle(ChatColor.DARK_RED + "ZEIT ABGELAUFEN!", ChatUtil.RED + "Challenge fehgeschlagen", 10, 60, 10); + p.sendTitle(ChatUtil.RED + "ZEIT ABGELAUFEN!", ChatUtil.RED + "Challenge fehgeschlagen", 10, 60, 10); } - ChatUtil.sendBrodcastMessage(ChatColor.DARK_RED + "Die Zeit ist abgelaufen und die Challenge somit fehlgeschlagen!"); - ChatUtil.sendBrodcastMessage("Seed: " + ChatColor.AQUA + Bukkit.getWorlds().get(0).getSeed()); + ChatUtil.sendBrodcastMessage(ChatUtil.RED + "Die Zeit ist abgelaufen und die Challenge somit fehlgeschlagen!"); + ChatUtil.sendBrodcastMessage("Seed: " + ChatUtil.BLUE + Bukkit.getWorlds().get(0).getSeed()); } stopTimer(); } else { diff --git a/src/main/java/de/fanta/challenges/challenges/ChallengeGoals.java b/src/main/java/de/fanta/challenges/challenges/ChallengeGoals.java index 5d698a7..53232d6 100644 --- a/src/main/java/de/fanta/challenges/challenges/ChallengeGoals.java +++ b/src/main/java/de/fanta/challenges/challenges/ChallengeGoals.java @@ -25,9 +25,9 @@ ChatUtil.sendBrodcastMessage(""); ChatUtil.sendBrodcastMessage(""); ChatUtil.sendBrodcastMessage(""); - ChatUtil.sendBrodcastMessage(" §8>> §7Der §2§l" + e.getEntity().getName().toLowerCase() + " §7wurde besiegt."); - ChatUtil.sendBrodcastMessage(" §8>> §7Benötigte Zeit: §2§l" + plugin.getTimer().formatTime(ChatUtil.GREEN) + "§7!"); - ChatUtil.sendBrodcastMessage(" §8>> §7Seed: §2§l" + Bukkit.getWorlds().get(0).getSeed()); + ChatUtil.sendBrodcastMessage(ChatUtil.ORANGE + " >> " + ChatUtil.GREEN + "Der " + ChatUtil.BLUE + ChatColor.BOLD + e.getEntity().getName().toLowerCase() + ChatUtil.GREEN + " wurde besiegt."); + ChatUtil.sendBrodcastMessage(ChatUtil.ORANGE + " >> " + ChatUtil.GREEN + "Benötigte Zeit: " + plugin.getTimer().formatTime(ChatUtil.BLUE) + ChatUtil.GREEN + "!"); + ChatUtil.sendBrodcastMessage(ChatUtil.ORANGE + " >> " + ChatUtil.GREEN + "Seed: " + ChatUtil.BLUE + ChatColor.BOLD + Bukkit.getWorlds().get(0).getSeed()); ChatUtil.sendBrodcastMessage(""); ChatUtil.sendBrodcastMessage(""); ChatUtil.sendBrodcastMessage(""); diff --git a/src/main/java/de/fanta/challenges/challenges/OreBattle.java b/src/main/java/de/fanta/challenges/challenges/OreBattle.java index 0568d25..0688e05 100644 --- a/src/main/java/de/fanta/challenges/challenges/OreBattle.java +++ b/src/main/java/de/fanta/challenges/challenges/OreBattle.java @@ -122,7 +122,7 @@ } else { plugin.getScoreManager().updateTeamScore(e.getPlayer(), blocklist.get(e.getBlock().getType())); } - ChatUtil.sendTitleToAll("", ChatColor.BLUE + new ItemStack(e.getBlock().getType()).getI18NDisplayName() + ChatColor.GREEN + " +" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN, 3, 20, 3, false); + ChatUtil.sendTitleToAll("", ChatUtil.BLUE + new ItemStack(e.getBlock().getType()).getI18NDisplayName() + ChatUtil.GREEN + " +" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN, 3, 20, 3, false); } } } @@ -136,7 +136,7 @@ } else { plugin.getScoreManager().updateTeamScore(e.getPlayer(), -blocklist.get(e.getBlock().getType())); } - ChatUtil.sendTitleToAll("", ChatColor.BLUE + new ItemStack(e.getBlock().getType()).getI18NDisplayName() + ChatColor.RED + " -" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN, 3, 20, 3, false); + ChatUtil.sendTitleToAll("", ChatUtil.BLUE + new ItemStack(e.getBlock().getType()).getI18NDisplayName() + ChatUtil.RED + " -" + blocklist.get(e.getBlock().getType()), ChatUtil.GREEN, 3, 20, 3, false); } } } diff --git a/src/main/java/de/fanta/challenges/commands/reset/ResetConfirmCommand.java b/src/main/java/de/fanta/challenges/commands/reset/ResetConfirmCommand.java index 2763b61..7cb521a 100644 --- a/src/main/java/de/fanta/challenges/commands/reset/ResetConfirmCommand.java +++ b/src/main/java/de/fanta/challenges/commands/reset/ResetConfirmCommand.java @@ -46,10 +46,10 @@ Bukkit.getPluginManager().callEvent(new EventStatusChangedEvent(false)); for (Player p : Bukkit.getOnlinePlayers()) { if (plugin.getServerType() == ServerType.CHALLENGE || plugin.getServerType() == ServerType.CHALLENGE_EVENT) { - p.sendTitle(ChatColor.of("#0ddead") + "Server wird zurückgesetzt!", ChatUtil.RED + "Bitte warte einen Moment" + ChatColor.of("#0ddead") + "." + ChatColor.AQUA + "." + ChatColor.YELLOW + ".", 10, 220, 10); + p.sendTitle(ChatUtil.BLUE + "Server wird zurückgesetzt!", ChatUtil.RED + "Bitte warte einen Moment" + ChatUtil.BLUE + "." + ChatUtil.GREEN + "." + ChatUtil.YELLOW + ".", 10, 220, 10); GlobalApi.portOnlinePlayerToLocation(p.getName(), "challenge"); } else if (plugin.getServerType() == ServerType.ADVENTURE) { - p.sendTitle(ChatColor.of("#0ddead") + "Server wird gestoppt!", ChatUtil.RED + "Bitte warte einen Moment" + ChatColor.of("#0ddead") + "." + ChatColor.AQUA + "." + ChatColor.YELLOW + ".", 10, 220, 10); + p.sendTitle(ChatUtil.BLUE + "Server wird gestoppt!", ChatUtil.RED + "Bitte warte einen Moment" + ChatUtil.BLUE + "." + ChatUtil.GREEN + "." + ChatUtil.YELLOW + ".", 10, 220, 10); GlobalApi.portOnlinePlayerToLocation(p.getName(), "adventure"); } plugin.delteTexturePack(); diff --git a/src/main/java/de/fanta/challenges/guis/BackpackGui.java b/src/main/java/de/fanta/challenges/guis/BackpackGui.java index f63c190..b5eb941 100644 --- a/src/main/java/de/fanta/challenges/guis/BackpackGui.java +++ b/src/main/java/de/fanta/challenges/guis/BackpackGui.java @@ -43,7 +43,7 @@ ItemStack item = backpack.getItem(i); if (item != null && item.getType() != Material.AIR) { if (!newBackpack.addItem(item).isEmpty()) { - ChatUtil.sendBrodcastMessage(ChatColor.DARK_RED + "Backpack kann nicht verkleinert werden. Zu wenig Platz!"); + ChatUtil.sendBrodcastMessage(ChatUtil.RED + "Backpack kann nicht verkleinert werden. Zu wenig Platz!"); return; } } diff --git a/src/main/java/de/fanta/challenges/guis/ResetGui.java b/src/main/java/de/fanta/challenges/guis/ResetGui.java index 1389758..b02aaf6 100644 --- a/src/main/java/de/fanta/challenges/guis/ResetGui.java +++ b/src/main/java/de/fanta/challenges/guis/ResetGui.java @@ -24,7 +24,7 @@ public static final Inventory RESET_GUI = Bukkit.createInventory(null, InventoryType.HOPPER, plugin.getGUIPREFIX() + " >> Reset"); public static void createResetGUI(Player p) { - RESET_GUI.setItem(RESET_INDEX, GUIUtils.createGuiItem(Material.REPEATING_COMMAND_BLOCK, ChatColor.DARK_RED + "Server resetten", ChatUtil.RED + "Wenn du denn Server resettest wird", ChatUtil.RED + "der Server komplett zurückgesetzt", ChatUtil.RED + "und du musst von vorne beginnen!")); + RESET_GUI.setItem(RESET_INDEX, GUIUtils.createGuiItem(Material.REPEATING_COMMAND_BLOCK, ChatUtil.RED + "Server resetten", ChatUtil.RED + "Wenn du denn Server resettest wird", ChatUtil.RED + "der Server komplett zurückgesetzt", ChatUtil.RED + "und du musst von vorne beginnen!")); for (int i = 0; i < INVENTORY_SIZE; i++) { ItemStack item = RESET_GUI.getItem(i); if (item == null || item.getType() == Material.AIR) { diff --git a/src/main/java/de/fanta/challenges/guis/TimerGui.java b/src/main/java/de/fanta/challenges/guis/TimerGui.java index 780dfca..8c28b40 100644 --- a/src/main/java/de/fanta/challenges/guis/TimerGui.java +++ b/src/main/java/de/fanta/challenges/guis/TimerGui.java @@ -28,7 +28,7 @@ public static void createTimerGUI(Player p) { if (plugin.getTimer().isReverse()) { - TIMER_GUI.setItem(11, GUIUtils.createGuiItem(Material.MAGENTA_GLAZED_TERRACOTTA, ChatColor.AQUA + "Timer Richtung - rückwärts")); + TIMER_GUI.setItem(11, GUIUtils.createGuiItem(Material.MAGENTA_GLAZED_TERRACOTTA, ChatUtil.BLUE + "Timer Richtung - rückwärts")); } else { TIMER_GUI.setItem(11, GUIUtils.createGuiItem(Material.MAGENTA_GLAZED_TERRACOTTA, ChatUtil.GREEN + "Timer Richtung - vorwärts")); } @@ -59,22 +59,16 @@ if (slot == 15) { if (plugin.getTimer().isRunning()) { plugin.getTimer().stopTimer(); - for (Player pp : Bukkit.getOnlinePlayers()) { - pp.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); - if (plugin.getServerType() != ServerType.ADVENTURE) { - world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false); - } - pp.sendTitle(ChatColor.of("#0ddead") + "Timer", ChatUtil.RED + "Der Timer wurde pausiert.", 10, 40, 10); + if (plugin.getServerType() != ServerType.ADVENTURE) { + world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, false); } + ChatUtil.sendTitleToAll("Timer", ChatUtil.RED + "Der Timer wurde pausiert.", ChatUtil.BLUE, 10, 60, 10, true); } else { plugin.getTimer().startTimer(); - for (Player pp : Bukkit.getOnlinePlayers()) { - pp.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0F, 2.0F); - if (plugin.getServerType() != ServerType.ADVENTURE) { - world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true); - } - pp.sendTitle(ChatColor.of("#0ddead") + "Timer", ChatUtil.GREEN + "Der Timer wurde gestartet.", 10, 60, 10); + if (plugin.getServerType() != ServerType.ADVENTURE) { + world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true); } + ChatUtil.sendTitleToAll("Timer", ChatUtil.GREEN + "Der Timer wurde gestartet.", ChatUtil.BLUE, 10, 60, 10, true); } p.closeInventory(); } else if (slot == 11) { @@ -83,7 +77,7 @@ GUIUtils.sendTitleToAll("Timer", "Der Timer läuft jetzt vorwärts.", ChatUtil.GREEN); } else { plugin.getTimer().reverseTimer(); - GUIUtils.sendTitleToAll("Timer", "Der Timer läuft jetzt rückwärts.", ChatColor.AQUA); + GUIUtils.sendTitleToAll("Timer", "Der Timer läuft jetzt rückwärts.", ChatUtil.BLUE); } p.closeInventory(); } else if (slot == SHOWTIMER_INDEX) { diff --git a/src/main/java/de/fanta/challenges/guis/settingsgui/ServerSettingsGui.java b/src/main/java/de/fanta/challenges/guis/settingsgui/ServerSettingsGui.java index ed1c2e4..4b09601 100644 --- a/src/main/java/de/fanta/challenges/guis/settingsgui/ServerSettingsGui.java +++ b/src/main/java/de/fanta/challenges/guis/settingsgui/ServerSettingsGui.java @@ -33,11 +33,11 @@ public static void createServerSettingsGUI(Player p) { if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.EASY) { - SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.IRON_SWORD, ChatColor.AQUA + "Schwierigkeitsgrad Leicht")); + SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.IRON_SWORD, ChatUtil.BLUE + "Schwierigkeitsgrad Leicht")); } else if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.NORMAL) { - SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.DIAMOND_SWORD, ChatUtil.RED + "Schwierigkeitsgrad Mittel")); + SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.DIAMOND_SWORD, ChatUtil.ORANGE + "Schwierigkeitsgrad Mittel")); } else if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.HARD) { - SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.NETHERITE_SWORD, ChatColor.DARK_RED + "Schwierigkeitsgrad Schwer")); + SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.NETHERITE_SWORD, ChatUtil.RED + "Schwierigkeitsgrad Schwer")); } else if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.PEACEFUL) { SERVER_SETTINGS_GUI.setItem(DIFFICULTY_INDEX, GUIUtils.createGuiItem(Material.POPPY, ChatUtil.GREEN + "Schwierigkeitsgrad Friedlich")); } @@ -93,12 +93,12 @@ plugin.getServer().getWorld("world").setDifficulty(Difficulty.NORMAL); plugin.getServer().getWorld("world_nether").setDifficulty(Difficulty.NORMAL); plugin.getServer().getWorld("world_the_end").setDifficulty(Difficulty.NORMAL); - GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Mittel", ChatUtil.RED); + GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Mittel", ChatUtil.ORANGE); } else if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.NORMAL) { plugin.getServer().getWorld("world").setDifficulty(Difficulty.HARD); plugin.getServer().getWorld("world_nether").setDifficulty(Difficulty.HARD); plugin.getServer().getWorld("world_the_end").setDifficulty(Difficulty.HARD); - GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Schwer", ChatColor.DARK_RED); + GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Schwer", ChatUtil.RED); } else if (plugin.getServer().getWorld("world").getDifficulty() == Difficulty.HARD) { plugin.getServer().getWorld("world").setDifficulty(Difficulty.PEACEFUL); plugin.getServer().getWorld("world_nether").setDifficulty(Difficulty.PEACEFUL); @@ -108,7 +108,7 @@ plugin.getServer().getWorld("world").setDifficulty(Difficulty.EASY); plugin.getServer().getWorld("world_nether").setDifficulty(Difficulty.EASY); plugin.getServer().getWorld("world_the_end").setDifficulty(Difficulty.EASY); - GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Leicht", ChatColor.AQUA); + GUIUtils.sendTitleToAll("Server Einstellungen", "Schwierigkeitsgrad Leicht", ChatUtil.BLUE); } break; case PVP_INDEX: diff --git a/src/main/java/de/fanta/challenges/listeners/DeathListener.java b/src/main/java/de/fanta/challenges/listeners/DeathListener.java index ec38ba1..326bef9 100644 --- a/src/main/java/de/fanta/challenges/listeners/DeathListener.java +++ b/src/main/java/de/fanta/challenges/listeners/DeathListener.java @@ -27,7 +27,7 @@ p.setGameMode(GameMode.SPECTATOR); } e.setDeathMessage(plugin.getPREFIX() + " " + ChatUtil.BLUE + e.getEntity().getName() + ChatUtil.GREEN + " ist gestorben!"); - ChatUtil.sendBrodcastMessage("Verschwendete Zeit " + plugin.getTimer().formatTime(ChatColor.GOLD)); + ChatUtil.sendBrodcastMessage("Verschwendete Zeit " + plugin.getTimer().formatTime(ChatUtil.ORANGE)); ChatUtil.sendBrodcastMessage("Welt Seed: " + Bukkit.getWorlds().get(0).getSeed()); ChatUtil.sendBrodcastMessage("Um alle wiederzubeleben benutze §c/revive ALL"); } else { diff --git a/src/main/java/de/fanta/challenges/listeners/PlayerListener.java b/src/main/java/de/fanta/challenges/listeners/PlayerListener.java index d720764..d6ce06a 100644 --- a/src/main/java/de/fanta/challenges/listeners/PlayerListener.java +++ b/src/main/java/de/fanta/challenges/listeners/PlayerListener.java @@ -4,6 +4,7 @@ import de.fanta.challenges.ServerType; import de.fanta.challenges.events.PlayerCountChangedEvent; import de.fanta.challenges.utils.ChatUtil; +import de.iani.cubesideutils.StringUtil; import de.iani.cubesideutils.commands.ArgsParser; import de.tr7zw.changeme.nbtapi.NBTCompoundList; import de.tr7zw.changeme.nbtapi.NBTItem; @@ -250,7 +251,7 @@ return; } for (String coloredlore : lorelist) { - String lore = ChatColor.stripColor(coloredlore); + String lore = StringUtil.stripColors(coloredlore); if (lore.endsWith("I") || lore.endsWith("V") || lore.endsWith("X")) { NBTItem nbti = new NBTItem(itemStack); //TODO Class not Found. Why??? diff --git a/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java b/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java index 26f0dee..eda6ff0 100644 --- a/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java +++ b/src/main/java/de/fanta/challenges/listeners/QuitJoinListener.java @@ -40,7 +40,7 @@ } if (!plugin.getVanish().isVanish(p)) { - ChatUtil.sendBrodcastMessage(ChatUtil.BLUE + p.getName() + ChatUtil.GREEN + " hat die Lobby betreten! " + ChatColor.of("#E4E737") + "[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers()) + "/" + Bukkit.getServer().getMaxPlayers() + "]"); + ChatUtil.sendBrodcastMessage(ChatUtil.BLUE + p.getName() + ChatUtil.GREEN + " hat die Lobby betreten! " + ChatUtil.YELLOW + "[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers()) + "/" + Bukkit.getServer().getMaxPlayers() + "]"); e.setJoinMessage(null); if (plugin.getServerType() != ServerType.ADVENTURE) { if (!DeathrunChallengeEvent.getDeadPlayer().contains(p.getUniqueId().toString())) { @@ -123,7 +123,7 @@ } if (!plugin.getVanish().isVanish(player)) { e.setQuitMessage(null); - ChatUtil.sendBrodcastMessage(ChatUtil.BLUE + player.getName() + ChatColor.of("#C45B3D") + " hat die Lobby verlassen! " + ChatColor.of("#E4E737") + "[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1) + "/" + Bukkit.getServer().getMaxPlayers() + "]"); + ChatUtil.sendBrodcastMessage(ChatUtil.BLUE + player.getName() + ChatUtil.RED + " hat die Lobby verlassen! " + ChatUtil.YELLOW + "[" + (Bukkit.getServer().getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1) + "/" + Bukkit.getServer().getMaxPlayers() + "]"); this.plugin.getSBManager().removeScoreboard(player); Bukkit.getPluginManager().callEvent(new PlayerCountChangedEvent(Bukkit.getOnlinePlayers().size() - plugin.getVanish().countVanishPlayers() - 1)); diff --git a/src/main/java/de/fanta/challenges/utils/ChatUtil.java b/src/main/java/de/fanta/challenges/utils/ChatUtil.java index cf3a5ca..c6d0ebb 100644 --- a/src/main/java/de/fanta/challenges/utils/ChatUtil.java +++ b/src/main/java/de/fanta/challenges/utils/ChatUtil.java @@ -11,8 +11,10 @@ public class ChatUtil { public static final ChatColor GREEN = ChatColor.of("#52ff9d"); + public static final ChatColor YELLOW = ChatColor.of("#E4E737"); public static final ChatColor ORANGE = ChatColor.of("#ffac4d"); public static final ChatColor RED = ChatColor.of("#ff6b6b"); + public static final ChatColor PINK = ChatColor.of("#FF04F7"); public static final ChatColor BLUE = ChatColor.of("#87f7ea"); private ChatUtil() { @@ -38,7 +40,7 @@ public static void sendDebugMessage(CommandSender sender, Object... messageParts) { if (sender.hasPermission("fanta.debug")) { if (sender != null) { - sendMessage(sender, ChatColor.of("#FF04F7").toString(), messageParts); + sendMessage(sender, PINK.toString(), messageParts); } } }