From 8cab75b90faf128474b3788e9a26e03826d7686e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sat, 17 Apr 2021 22:56:15 +0200 Subject: [PATCH] Add ColorConfig to softcode every Color we use --- .../src/de/steamwar/bausystem/BauSystem.java | 4 +-- .../bausystem/config/ColorConfig.java | 35 +++++++++++++++++++ .../features/tracer/TraceCommand.java | 9 ++--- 3 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java diff --git a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java index 9e86bac9..3562cf5a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/BauSystem.java @@ -19,9 +19,9 @@ package de.steamwar.bausystem; +import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.linkage.LinkageUtils; import lombok.Getter; -import net.md_5.bungee.api.ChatColor; import org.bukkit.event.Listener; import org.bukkit.plugin.java.JavaPlugin; @@ -30,7 +30,7 @@ public class BauSystem extends JavaPlugin implements Listener { @Getter private static BauSystem instance; - public static final String PREFIX = ChatColor.YELLOW + "BauSystem" + ChatColor.DARK_GRAY + "» " + ChatColor.GRAY; + public static final String PREFIX = ColorConfig.HIGHLIGHT + "BauSystem" + ColorConfig.OTHER + "» " + ColorConfig.BASE; @Override public void onEnable() { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java b/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java new file mode 100644 index 00000000..791c32b1 --- /dev/null +++ b/BauSystem_Main/src/de/steamwar/bausystem/config/ColorConfig.java @@ -0,0 +1,35 @@ +/* + * 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; + + public final ChatColor ENABLE = ChatColor.GREEN; + public final ChatColor DISABLE = ChatColor.RED; + +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java index 7b1bc961..6b7060fe 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -21,6 +21,7 @@ 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.show.ShowModeParameter; import de.steamwar.bausystem.features.tracer.show.ShowModeParameterType; @@ -41,11 +42,11 @@ public class TraceCommand extends SWCommand { @Register(help = true) public void genericHelp(Player p, String... args) { - p.sendMessage("§8/§etrace start §8- §7Startet die Aufnahme aller TNT-Positionen"); - p.sendMessage("§8/§etrace stop §8- §7Stoppt den TNT-Tracer"); - p.sendMessage("§8/§etrace toggleauto §8- §7Automatischer Aufnahmenstart"); + p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace start " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Startet die Aufnahme aller TNT-Positionen"); + p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace stop " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Stoppt den TNT-Tracer"); + p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace toggleauto " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Automatischer Aufnahmenstart"); // p.sendMessage("§8/§etrace show gui §8- §7Zeigt die Trace show gui"); - p.sendMessage("§8/§etrace show §8<§e-water§8|§e-interpolate-xz§8|§e-interpolate-y§8> §8- §7Zeigt alle TNT-Positionen"); + p.sendMessage(ColorConfig.OTHER + "/" + ColorConfig.HIGHLIGHT + "trace show " + ColorConfig.OTHER + "<" + ColorConfig.HIGHLIGHT + "-water" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-xz" + ColorConfig.OTHER + "|" + ColorConfig.HIGHLIGHT + "-interpolate-y" + ColorConfig.OTHER + "> " + ColorConfig.OTHER + "- " + ColorConfig.BASE + "Zeigt alle TNT-Positionen"); p.sendMessage("§8/§etrace hide §8- §7Versteckt alle TNT-Positionen"); p.sendMessage("§8/§etrace delete §8- §7Löscht alle TNT-Positionen"); // p.sendMessage("§8/§etrace list §8<§7FRAME-ID§8> §8- §7Listet alle TNT auf");