From a002a6ef162ad325aad88bb26efa27945779b5d9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 3 May 2021 20:40:44 +0200 Subject: [PATCH] Add Flag Multilingual --- BauSystem_Main/src/BauSystem.properties | 23 ++++++++++++++++++- .../steamwar/bausystem/region/flags/Flag.java | 10 ++++---- .../region/flags/flagvalues/FireMode.java | 5 ++-- .../region/flags/flagvalues/FreezeMode.java | 11 ++------- .../region/flags/flagvalues/ProtectMode.java | 5 ++-- .../region/flags/flagvalues/TNTMode.java | 7 +++--- 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 3309bc50..8fa1770c 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -1,9 +1,30 @@ PREFIX = §eBau§8System §8» +# Permission PERMISSION_WORLD = Einstellungen vornehmen PERMISSION_WORLD_EDIT = WorldEdit verwenden PERMISSION_CHANGE_YOU_ENABLE = §aDer Spieler darf nun {0} PERMISSION_CHANGE_YOU_DISABLE = §cDer Spieler darf nun nicht mehr {0} PERMISSION_CHANGE_OTHER_ENABLE = §aDu kannst nun auf der Welt von §6{0}§a {1} -PERMISSION_CHANGE_OTHER_DISABLE = §cDu kannst nun nicht mehr auf der Welt von §6{0}§c {1} \ No newline at end of file +PERMISSION_CHANGE_OTHER_DISABLE = §cDu kannst nun nicht mehr auf der Welt von §6{0}§c {1} + +# Flags +FLAG_FIRE_ALLOW = §can +FLAG_FIRE_DENY = §aaus + +FLAG_FREEZE_ACTIVE = §aan +FLAG_FREEZE_INACTIVE = §aaus + +FLAG_PROTECT_ACTIVE = §aan +FLAG_PROTECT_INACTIVE = §aaus + +FLAG_TNT_ALLOW = §aan +FLAG_TNT_DENY = §caus +FLAG_TNT_ONLY_TB = §7Kein §eBaurahmen + +FLAG_COLOR = Color +FLAG_TNT = TNT +FLAG_FIRE = Fire +FLAG_FREEZE = Freeze +FLAG_PROTECT = Protect \ No newline at end of file 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 c56dff91..dbfb9b39 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/Flag.java @@ -29,11 +29,11 @@ import lombok.Getter; @Getter public enum Flag implements EnumDisplay { - COLOR("Color", ColorMode.class, ColorMode.YELLOW), - TNT("TNT", TNTMode.class, TNTMode.ONLY_TB), - FIRE("Fire", FireMode.class, FireMode.ALLOW), - FREEZE("Freeze", FreezeMode.class, FreezeMode.INACTIVE), - PROTECT("Protect", ProtectMode.class, ProtectMode.INACTIVE); + COLOR("FLAG_COLOR", ColorMode.class, ColorMode.YELLOW), + TNT("FLAG_TNT", TNTMode.class, TNTMode.ONLY_TB), + FIRE("FLAG_FIRE", FireMode.class, FireMode.ALLOW), + FREEZE("FLAG_FREEZE", FreezeMode.class, FreezeMode.INACTIVE), + PROTECT("FLAG_PROTECT", ProtectMode.class, ProtectMode.INACTIVE); @Getter private static final Set flags; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FireMode.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FireMode.java index 920968bf..8b08f0a6 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FireMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FireMode.java @@ -19,7 +19,6 @@ package de.steamwar.bausystem.region.flags.flagvalues; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.region.flags.Flag; import lombok.AllArgsConstructor; import lombok.Getter; @@ -28,8 +27,8 @@ import lombok.Getter; @AllArgsConstructor public enum FireMode implements Flag.Value { - ALLOW(ColorConfig.DISABLE + "an"), - DENY(ColorConfig.ENABLE + "aus"); + ALLOW("FLAG_FIRE_ALLOW"), + DENY("FLAG_FIRE_DENY"); private static FireMode[] values; private final String chatValue; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FreezeMode.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FreezeMode.java index 61fbdf1a..8e51bb29 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FreezeMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/FreezeMode.java @@ -20,7 +20,6 @@ package de.steamwar.bausystem.region.flags.flagvalues; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.region.flags.Flag; import lombok.AllArgsConstructor; import lombok.Getter; @@ -29,11 +28,10 @@ import lombok.Getter; @AllArgsConstructor public enum FreezeMode implements Flag.Value { - ACTIVE("activate", ColorConfig.ENABLE + "an"), - INACTIVE("deactivate", ColorConfig.DISABLE + "aus"); + ACTIVE("FLAG_FREEZE_ACTIVE"), + INACTIVE("FLAG_FREEZE_INACTIVE"); private static FreezeMode[] values; - private final String descriptor; private final String chatValue; @Override @@ -60,9 +58,4 @@ public enum FreezeMode implements Flag.Value { return FreezeMode.INACTIVE; } } - - @Override - public String toString() { - return this.descriptor; - } } \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ProtectMode.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ProtectMode.java index d11efa44..35d3c12a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ProtectMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/ProtectMode.java @@ -19,7 +19,6 @@ package de.steamwar.bausystem.region.flags.flagvalues; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.region.flags.Flag; import lombok.AllArgsConstructor; import lombok.Getter; @@ -28,8 +27,8 @@ import lombok.Getter; @AllArgsConstructor public enum ProtectMode implements Flag.Value { - ACTIVE(ColorConfig.ENABLE + "an"), - INACTIVE(ColorConfig.DISABLE + "aus"); + ACTIVE("FLAG_PROTECT_ACTIVE"), + INACTIVE("FLAG_PROTECT_INACTIVE"); private static ProtectMode[] values; private final String chatValue; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/TNTMode.java b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/TNTMode.java index 20b08b25..548b8ff0 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/TNTMode.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/flags/flagvalues/TNTMode.java @@ -19,7 +19,6 @@ package de.steamwar.bausystem.region.flags.flagvalues; -import de.steamwar.bausystem.config.ColorConfig; import de.steamwar.bausystem.region.flags.Flag; import lombok.AllArgsConstructor; import lombok.Getter; @@ -28,9 +27,9 @@ import lombok.Getter; @AllArgsConstructor public enum TNTMode implements Flag.Value { - ALLOW(ColorConfig.ENABLE + "an"), - DENY(ColorConfig.DISABLE + "aus"), - ONLY_TB(ColorConfig.BASE + "Kein " + ColorConfig.HIGHLIGHT + "Baurahmen"); + ALLOW("FLAG_TNT_ALLOW"), + DENY("FLAG_TNT_DENY"), + ONLY_TB("FLAG_TNT_ONLY_TB"); private static TNTMode[] values; private final String chatValue;