From 4a403efd6ef0234c076a3e80a53bf9399b88ce9e Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 18 Apr 2021 00:29:07 +0200 Subject: [PATCH 1/3] Rename WorldSpawnCommand --- .../other/{WorldspawnCommand.java => WorldSpawnCommand.java} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename BauSystem_Main/src/de/steamwar/bausystem/features/other/{WorldspawnCommand.java => WorldSpawnCommand.java} (95%) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldspawnCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldSpawnCommand.java similarity index 95% rename from BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldspawnCommand.java rename to BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldSpawnCommand.java index 44d126ba..6150d344 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldspawnCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/other/WorldSpawnCommand.java @@ -29,11 +29,11 @@ import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerTeleportEvent; @Linked(LinkageType.COMMAND) -public class WorldspawnCommand extends SWCommand { +public class WorldSpawnCommand extends SWCommand { private static final World WORLD = Bukkit.getWorlds().get(0); - public WorldspawnCommand() { + public WorldSpawnCommand() { super("worldspawn"); } From f101c4aaa0d045b1fd2f7fd5a6c9f9bbf373aba0 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 18 Apr 2021 00:40:54 +0200 Subject: [PATCH 2/3] Declutter .gitkeep --- BauSystem_15/src/de/steamwar/bausystem/.gitkeep | 0 BauSystem_API/src/de/steamwar/bausystem/.gitkeep | 0 BauSystem_Main/src/de/steamwar/bausystem/region/.gitkeep | 0 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 BauSystem_15/src/de/steamwar/bausystem/.gitkeep delete mode 100644 BauSystem_API/src/de/steamwar/bausystem/.gitkeep delete mode 100644 BauSystem_Main/src/de/steamwar/bausystem/region/.gitkeep diff --git a/BauSystem_15/src/de/steamwar/bausystem/.gitkeep b/BauSystem_15/src/de/steamwar/bausystem/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/BauSystem_API/src/de/steamwar/bausystem/.gitkeep b/BauSystem_API/src/de/steamwar/bausystem/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/.gitkeep b/BauSystem_Main/src/de/steamwar/bausystem/region/.gitkeep deleted file mode 100644 index e69de29b..00000000 From 9fb8b4e4469de4c8a2425e709e3b667e155f0d6f Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 18 Apr 2021 00:54:46 +0200 Subject: [PATCH 3/3] Add Color Implement ColorMode --- .../de/steamwar/bausystem/region/Color.java | 39 ++++++++++++++ .../steamwar/bausystem/region/flags/Flag.java | 1 + .../region/flags/flagvalues/ColorMode.java | 52 ++++++++++++++++++- 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 BauSystem_API/src/de/steamwar/bausystem/region/Color.java diff --git a/BauSystem_API/src/de/steamwar/bausystem/region/Color.java b/BauSystem_API/src/de/steamwar/bausystem/region/Color.java new file mode 100644 index 00000000..a50c7cb0 --- /dev/null +++ b/BauSystem_API/src/de/steamwar/bausystem/region/Color.java @@ -0,0 +1,39 @@ +/* + * 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.region; + +public enum Color { + WHITE, + ORANGE, + MAGENTA, + LIGHT_BLUE, + YELLOW, + LIME, + PINK, + GRAY, + LIGHT_GRAY, + CYAN, + PURPLE, + BLUE, + BROWN, + GREEN, + RED, + BLACK; +} diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java index c89265b2..9502abdf 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java @@ -27,6 +27,7 @@ import lombok.Getter; @Getter public enum Flag { + COLOR(ColorMode.class, ColorMode.YELLOW), TNT(TNTMode.class, TNTMode.ALLOW), FIRE(FireMode.class, FireMode.ALLOW), FREEZE(FreezeMode.class, FreezeMode.INACTIVE), diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ColorMode.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ColorMode.java index a98ee449..1287a810 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ColorMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ColorMode.java @@ -19,5 +19,55 @@ package de.steamwar.bausystem.region.flags.flagvalues; -public enum ColorMode { +import de.steamwar.bausystem.region.Color; +import de.steamwar.bausystem.region.flags.Flag; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum ColorMode implements Flag.Value { + WHITE(Color.WHITE), + ORANGE(Color.ORANGE), + MAGENTA(Color.MAGENTA), + LIGHT_BLUE(Color.LIGHT_BLUE), + YELLOW(Color.YELLOW), + LIME(Color.LIME), + PINK(Color.PINK), + GRAY(Color.GRAY), + LIGHT_GRAY(Color.LIGHT_GRAY), + CYAN(Color.CYAN), + PURPLE(Color.PURPLE), + BLUE(Color.BLUE), + BROWN(Color.BROWN), + GREEN(Color.GREEN), + RED(Color.RED), + BLACK(Color.BLACK); + + private static ColorMode[] values; + private final Color color; + + private final String chatValue = name(); + + @Override + public ColorMode[] getValues() { + if (ColorMode.values == null) { + ColorMode.values = ColorMode.values(); //NOSONAR + } + return ColorMode.values; + } + + @Override + public ColorMode getValue() { + return this; + } + + @Override + public ColorMode getValueOf(final String name) { + try { + return ColorMode.valueOf(name); + } catch (IllegalArgumentException e) { + return ColorMode.YELLOW; + } + } }