From a0f405922a66e94b67ee36d97d5d2dda68dd10b6 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 30 Dec 2021 13:41:54 +0100 Subject: [PATCH] Remove ColorConfig.java Signed-off-by: yoyosource --- BauSystem_Main/src/BauSystem.properties | 4 +++ .../src/de/steamwar/bausystem/BauSystem.java | 3 -- .../steamwar/bausystem/config/BauServer.java | 1 - .../bausystem/config/ColorConfig.java | 30 ------------------- .../bausystem/features/gui/BauGUI.java | 4 +-- .../bausystem/features/gui/BauGUICommand.java | 4 +-- .../features/gui/BauGuiBauGuiItem.java | 3 +- .../features/gui/editor/BauGuiEditor.java | 3 +- .../features/loadtimer/Loadtimer.java | 4 +-- .../redstonetester/RedstonetesterUtils.java | 7 +---- .../depthcounter/DepthCounterCommand.java | 3 +- .../features/tracer/TracerBauGuiItem.java | 3 +- .../features/util/items/SkullBauGuiItem.java | 5 ++-- .../bausystem/worlddata/WorldData.java | 1 - 14 files changed, 18 insertions(+), 57 deletions(-) delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index d3eb4b47..a748165a 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -677,6 +677,8 @@ TRACE_COMMAND_HELP_DELETE = §8/§etrace delete §8- §7Löscht alle TNT-Positio TRACE_COMMAND_HELP_LIST = §8/§etrace list §8- §7Trace GUI nur im Chat TRACE_COMMAND_HELP_GUI = §8/§etrace gui §8- §7Zeigt die Trace Oberfläche an +TRACE_GUI_ITEM_NAME = §eTracer +TRACE_GUI_ITEM_LORE = §7Status§8: {0} TRACE_GUI_NAME = Tracer Gui TRACE_GUI_TRACE_INACTIVE = §eTracer Starten TRACE_GUI_TRACE_ACTIVE = §eTracer Stoppen @@ -869,6 +871,7 @@ OTHER_WORLDSPAWN_HELP=§8/§eworldspawn §8-§e Teleportiere dich zum Spawn DEBUG_STICK_COMMAND_HELP=§8/§edebugstick §8-§7 Erhalte einen DebugStick DEBUG_STICK_NAME=§eDebugstick #Skull Gui +SKULL_GUI_ITEM_NAME = §eSpieler Köpfe ANVIL_INV_NAME=Spieler name # StructureVoid STRUCTURE_VOID_COMMAND_HELP=§8/§estructureVoid §8-§7 Erhalte ein StructureVoid @@ -919,6 +922,7 @@ RT_ITEM_NAME=§eRedstonetester RT_ITEM_LORE_1=§eLinksklick Block §8-§7 Setzt die 1. Position RT_ITEM_LORE_2=§eRechtsklick Block §8-§7 Setzt die 2. Position RT_ITEM_LORE_3=§eShift-Rechtsklick Luft §8-§7 Zurücksetzten +RT_LOC=§8: §e{0} {1} {2} RT_INVALID_LOC=§cUnbekannte Position RT_RESULT=§7Differenz§8: §e{0}§7 Ticks §8,§7 R-Ticks §e{1} RT_ACTIVATE=§7Positionen gelöscht§8. diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 7439357f..60f193ce 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -19,7 +19,6 @@ package de.steamwar.bausystem; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.configplayer.Config; import de.steamwar.bausystem.linkage.LinkageUtils; import de.steamwar.bausystem.region.loader.PrototypeLoader; @@ -53,8 +52,6 @@ public class BauSystem extends JavaPlugin implements Listener { @Getter private static BauSystem instance; - public static final String PREFIX = ColorConfig.HIGHLIGHT + "BauSystem" + ColorConfig.OTHER + "» " + ColorConfig.BASE; - private World world; @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/config/BauServer.java b/BauSystem_Main/src/de/steamwar/bausystem/config/BauServer.java index 3ef8e516..804705c9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/config/BauServer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/config/BauServer.java @@ -61,5 +61,4 @@ public class BauServer { public int getOwnerID() { return SteamwarUser.get(getOwner()).getId(); } - } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java b/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java deleted file mode 100644 index 182aee1b..00000000 --- a/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2021 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.bausystem.config; - -import lombok.experimental.UtilityClass; -import net.md_5.bungee.api.ChatColor; - -@UtilityClass -public class ColorConfig { - public final ChatColor BASE = ChatColor.GRAY; - public final ChatColor HIGHLIGHT = ChatColor.YELLOW; - public final ChatColor OTHER = ChatColor.DARK_GRAY; -} \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java index ae788889..f4839a6c 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUI.java @@ -22,12 +22,12 @@ package de.steamwar.bausystem.features.gui; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.SWUtils; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.gui.editor.BauGuiMapping; import de.steamwar.bausystem.linkage.specific.BauGuiItem; import de.steamwar.inventory.SWInventory; import lombok.Getter; import lombok.experimental.UtilityClass; +import net.md_5.bungee.api.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -47,7 +47,7 @@ public class BauGUI { public static ItemStack getGUI_ITEM(Player p) { ItemStack GUI_ITEM = new ItemStack(Material.NETHER_STAR); ItemMeta meta = GUI_ITEM.getItemMeta(); - meta.setDisplayName(ColorConfig.HIGHLIGHT + BauSystem.MESSAGE.parse("GUI_NAME", p)); + meta.setDisplayName(ChatColor.YELLOW + BauSystem.MESSAGE.parse("GUI_NAME", p)); GUI_ITEM.setItemMeta(meta); return GUI_ITEM; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java index 4f24fcd5..dd03c091 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.features.gui; import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.gui.editor.BauGuiEditor; import de.steamwar.bausystem.features.gui.editor.BauGuiImportExport; import de.steamwar.bausystem.features.gui.editor.BauGuiMapping; @@ -28,6 +27,7 @@ import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.command.SWCommand; import de.steamwar.inventory.SWItem; +import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.HoverEvent; import net.md_5.bungee.api.chat.TextComponent; @@ -59,7 +59,7 @@ public class BauGUICommand extends SWCommand { public void exportGui(Player p) { String export = BauGuiImportExport.exportGui(BauGuiMapping.getGuiMapping(p)); TextComponent component = new TextComponent(); - component.setColor(ColorConfig.HIGHLIGHT); + component.setColor(ChatColor.YELLOW); component.setBold(true); component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(BauSystem.MESSAGE.parse("GUI_EXPORT_CODE_HOVER", p)))); component.setClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, export)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java index 125049c1..7e6f8f5e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGuiBauGuiItem.java @@ -26,6 +26,7 @@ import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.bausystem.linkage.specific.BauGuiItem; import de.steamwar.inventory.SWItem; +import net.md_5.bungee.api.ChatColor; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.ClickType; @@ -42,7 +43,7 @@ public class BauGuiBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.NETHER_STAR, ColorConfig.HIGHLIGHT + BauSystem.MESSAGE.parse("GUI_NAME", player), + return new SWItem(Material.NETHER_STAR, ChatColor.YELLOW + BauSystem.MESSAGE.parse("GUI_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("GUI_ITEM_LORE1", player), BauSystem.MESSAGE.parse("GUI_ITEM_LORE2", player)), false, clickType -> { }).getItemStack(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java index 631201fd..18d5b350 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditor.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.features.gui.editor; import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.gui.BauGUI; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; @@ -65,7 +64,7 @@ public class BauGuiEditor implements Listener { } for (int j = mapping.getSize(); j < mapping.getSize() + 9; j++) { - inv.setItem(j, new SWItem(Material.WHITE_STAINED_GLASS_PANE, ColorConfig.HIGHLIGHT + "").getItemStack()); + inv.setItem(j, new SWItem(Material.WHITE_STAINED_GLASS_PANE, "").getItemStack()); } inv.setItem(mapping.getSize() + 3, new SWItem(mapping.getSize() == 9 * 5 ? Material.GRAY_STAINED_GLASS_PANE : Material.LIME_STAINED_GLASS_PANE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_ROW_P", p)).getItemStack()); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java index 6601e494..e79d4171 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/loadtimer/Loadtimer.java @@ -200,7 +200,7 @@ public class Loadtimer implements Listener { if (tntPlaced.size() > 1) { BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_PLAYERTABLE_PLAYER", player, BauSystem.MESSAGE.parse("LOADTIMER_SUMARY_PLAYERTABLE_ALL", player), finalAllTnt, new DecimalFormat("#.#").format(finalAllTnt / (loadTime / 20D))); } - player.sendMessage(ColorConfig.BASE + ""); + player.sendMessage(""); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_TIMES_HEAD", player); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_TIMES_START", player); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_TIMES_ACTIVATION", player, new DecimalFormat("#.#").format((loadTime / 20D)), loadTime); @@ -209,7 +209,7 @@ public class Loadtimer implements Listener { BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_TIMES_EXPLOSION", player, new DecimalFormat("#.#").format((finalExplTime / 20D)), finalExplTime); } BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_TIMES_LAST", player); - player.sendMessage(ColorConfig.BASE + ""); + player.sendMessage(""); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_STATS_HEAD", player); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_STATS_TNT", player, finalAllTnt); BauSystem.MESSAGE.sendPrefixless("LOADTIMER_SUMARY_STATS_FREQ", player, 60D / (loadTime / 20D), 60D / ((finalExplTime + Math.max(ignTime, 0) + loadTime) / 20D)); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/redstonetester/RedstonetesterUtils.java b/BauSystem_Main/src/de/steamwar/bausystem/features/redstonetester/RedstonetesterUtils.java index c14d500e..c0736262 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/redstonetester/RedstonetesterUtils.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/redstonetester/RedstonetesterUtils.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.features.redstonetester; import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.tpslimit.TPSUtils; import de.steamwar.bausystem.utils.ItemUtils; import de.steamwar.inventory.SWItem; @@ -58,11 +57,7 @@ public class RedstonetesterUtils { private final Map playerMap = new HashMap<>(); public void sendLocation(Player player, String prefix, Location location) { - player.sendMessage(BauSystem.PREFIX + prefix + ColorConfig.OTHER + ": " + ColorConfig.HIGHLIGHT + locationToString(location)); - } - - public String locationToString(Location location) { - return location.getBlockX() + " " + location.getBlockY() + " " + location.getBlockZ(); + BauSystem.MESSAGE.send("RT_LOC", player, location.getBlockX(), location.getBlockY(), location.getBlockZ()); } @SuppressWarnings("BooleanMethodIsAlwaysInverted") diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterCommand.java index e1a91a60..5eaa9399 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/testblock/depthcounter/DepthCounterCommand.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.features.testblock.depthcounter; import de.steamwar.bausystem.BauSystem; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; import de.steamwar.command.SWCommand; @@ -36,7 +35,7 @@ public class DepthCounterCommand extends SWCommand { @Register(value = "toggle", description = "DEPTH_COUNTER_COMMAND_TOGGLE_HELP") public void toggleCommand(Player p, CountMode countMode) { DepthCounter.toggleMode(p, countMode); - p.sendMessage(BauSystem.PREFIX + "Aktive Zählmodi: " + ColorConfig.HIGHLIGHT + DepthCounter.getModes(p) + ColorConfig.BASE + "."); + BauSystem.MESSAGE.send("DEPTH_COUNTER_ACTIVE_MESSAGE", p, DepthCounter.getModes(p).toString()); } @Register(value = "enable", description = "DEPTH_COUNTER_COMMAND_ENABLE_HELP") diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java index 0ba6eb48..f0d7b156 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java @@ -21,7 +21,6 @@ package de.steamwar.bausystem.features.tracer; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.features.tracer.record.RecordStateMachine; import de.steamwar.bausystem.features.tracer.record.RecordStatus; import de.steamwar.bausystem.features.tracer.show.TraceShowManager; @@ -46,7 +45,7 @@ public class TracerBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.OBSERVER, ColorConfig.HIGHLIGHT + "Tracer", Arrays.asList(ColorConfig.BASE + "Status: " + BauSystem.MESSAGE.parse(RecordStateMachine.getRecordStatus().getName(), player)), false, clickType -> { + return new SWItem(Material.OBSERVER, BauSystem.MESSAGE.parse("TRACE_GUI_ITEM_NAME", player), Arrays.asList(BauSystem.MESSAGE.parse("TRACE_GUI_ITEM_LORE", player, BauSystem.MESSAGE.parse(RecordStateMachine.getRecordStatus().getName(), player))), false, clickType -> { }).getItemStack(); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java index 879a226e..ed74b2dd 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/util/items/SkullBauGuiItem.java @@ -21,10 +21,9 @@ package de.steamwar.bausystem.features.util.items; import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; -import de.steamwar.bausystem.config.ColorConfig; -import de.steamwar.bausystem.linkage.specific.BauGuiItem; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; +import de.steamwar.bausystem.linkage.specific.BauGuiItem; import de.steamwar.inventory.SWAnvilInv; import de.steamwar.inventory.SWItem; import org.bukkit.Material; @@ -41,7 +40,7 @@ public class SkullBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.PLAYER_HEAD, ColorConfig.HIGHLIGHT + "Spieler Köpfe").getItemStack(); + return new SWItem(Material.PLAYER_HEAD, BauSystem.MESSAGE.parse("SKULL_GUI_ITEM_NAME", player)).getItemStack(); } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/worlddata/WorldData.java b/BauSystem_Main/src/de/steamwar/bausystem/worlddata/WorldData.java index 63f6ffc0..6db980d2 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/worlddata/WorldData.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/worlddata/WorldData.java @@ -23,7 +23,6 @@ import de.steamwar.sql.SteamwarUser; import lombok.experimental.UtilityClass; import org.bukkit.Bukkit; import yapion.hierarchy.output.FileOutput; -import yapion.hierarchy.types.YAPIONArray; import yapion.hierarchy.types.YAPIONObject; import yapion.parser.YAPIONParser;