From 80bd8e8e4eaa2a402991213697fbf85fb5734f37 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 13 Jun 2021 22:59:48 +0200 Subject: [PATCH] Add Region Items Multi Lang Signed-off-by: Chaoscaot --- BauSystem_Main/src/BauSystem.properties | 22 ++++++++++++++++++- .../region/items/ColorBauGuiItem.java | 8 +++---- .../features/region/items/FireBauGuiItem.java | 8 +++---- .../region/items/FreezeBauGuiItem.java | 8 +++---- .../region/items/ProtectBauGuiItem.java | 8 +++---- .../region/items/ResetBauGuiItem.java | 8 +++---- .../region/items/TestblockBauGuiItem.java | 8 +++---- .../features/region/items/TntBauGuiItem.java | 18 +++++++-------- 8 files changed, 54 insertions(+), 34 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 4d61316b..bfa2cd80 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -358,4 +358,24 @@ RT_ITEM_LORE_2=§eRechtsklick Block §8-§7 Setzt die 2. Position RT_ITEM_LORE_3=§eShift-Rechtsklick Luft §8-§7 Zurücksetzten RT_INVALID_LOC=§cUnbekannte Position RT_RESULT=Differenz§8: §e{0}§7 Ticks §8,§7 R-Ticks §e{1} -RT_ACTIVATE=§7Positionen gelöscht§8. \ No newline at end of file +RT_ACTIVATE=§7Positionen gelöscht§8. +# Region Items +REGION_ITEM_COLOR=§7Color: §e{0} +REGION_ITEM_COLOR_CHOOSE=Farbe Wählen +REGION_ITEM_FIRE_ALLOW=§7Feuer: §eEingeschaltet +REGION_ITEM_FIRE_DISALLOW=§7Feuer: §eAusgeschaltet +REGION_ITEM_FREEZE_ALLOW=§7Freeze: §eEingeschaltet +REGION_ITEM_FREEZE_DISALLOW=§7Freeze: §eAusgeschaltet +REGION_ITEM_PROTECT_ALLOW=§7Protect: §eEingeschaltet +REGION_ITEM_PROTECT_DISALLOW=§7Protect: §eAusgeschaltet +REGION_ITEM_RESET=§eReset +REGION_ITEM_RESET_TITLE=Reset Prototypen wählen +REGION_ITEM_TESTBLOCK=§eTestblock +REGION_ITEM_TESTBLOCK_TITLE=Testblock wählen +REGION_ITEM_TNT_OFF=§7TNT: §eAusgeschaltet +REGION_ITEM_TNT_ONLY_TB=§7TNT: §enur Testblock +REGION_ITEM_TNT_ON=§7TNT: §eEingeschaltet +REGION_ITEM_SELECTOR_TITLE=Tnt Modus +REGION_ITEM_SELECTOR_ON=§eEinschalten +REGION_ITEM_SELECTOR_ONLY_TB=§enur Testblock +REGION_ITEM_SELECTOR_OFF=§eAusschalten \ No newline at end of file diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java index e5258c2e..8bcb437d 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ColorBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.bausystem.region.Color; import de.steamwar.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; @@ -87,7 +87,7 @@ public class ColorBauGuiItem extends BauGuiItem { public ItemStack getItem(Player player) { Region region = Region.getRegion(player.getLocation()); ColorMode mode = region.getPlain(Flag.COLOR, ColorMode.class); - return new SWItem(mapColor(mode.getColor()), ColorConfig.BASE + "Color: " + ColorConfig.HIGHLIGHT + mode.getChatValue()).getItemStack(); + return new SWItem(mapColor(mode.getColor()), BauSystem.MESSAGE.parse("REGION_ITEM_COLOR", player, mode.getChatValue())).getItemStack(); } @Override @@ -99,7 +99,7 @@ public class ColorBauGuiItem extends BauGuiItem { items.add(new SWListInv.SWListEntry<>(new SWItem(mapColor(value.getColor()), (byte) 0, "§f" + value.getChatValue(), Collections.emptyList(), value == current, clickType -> { }), value)); } - SWListInv inv = new SWListInv(p, "Farbe Wählen", items, (clickType, colorMode) -> { + SWListInv inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("REGION_ITEM_COLOR_CHOOSE", p), items, (clickType, colorMode) -> { p.closeInventory(); p.performCommand("color " + colorMode.getChatValue()); update(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java index f68ce58a..8986e806 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FireBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.flagvalues.FireMode; @@ -44,9 +44,9 @@ public class FireBauGuiItem extends BauGuiItem { public ItemStack getItem(Player player) { Region region = Region.getRegion(player.getLocation()); if (region.getPlain(Flag.FIRE, FireMode.class) == FireMode.ALLOW) { - return new SWItem(Material.FIRE_CHARGE, ColorConfig.BASE + "Feuer: " + ColorConfig.HIGHLIGHT + "Eingeschaltet").getItemStack(); + return new SWItem(Material.FIRE_CHARGE, BauSystem.MESSAGE.parse("REGION_ITEM_FIRE_ALLOW", player)).getItemStack(); } else { - return new SWItem(Material.FIREWORK_STAR, ColorConfig.BASE + "Feuer: " + ColorConfig.HIGHLIGHT + "Eingeschaltet").getItemStack(); + return new SWItem(Material.FIREWORK_STAR, BauSystem.MESSAGE.parse("REGION_ITEM_FIRE_DISALLOW", player)).getItemStack(); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java index 307f158b..a107652e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/FreezeBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.flagvalues.FreezeMode; @@ -44,9 +44,9 @@ public class FreezeBauGuiItem extends BauGuiItem { public ItemStack getItem(Player player) { Region region = Region.getRegion(player.getLocation()); if (region.getPlain(Flag.FREEZE, FreezeMode.class) == FreezeMode.ACTIVE) { - return new SWItem(Material.GUNPOWDER, ColorConfig.BASE + "Freeze: " + ColorConfig.HIGHLIGHT + "Eingeschaltet").getItemStack(); + return new SWItem(Material.GUNPOWDER, BauSystem.MESSAGE.parse("REGION_ITEM_FREEZE_ALLOW", player)).getItemStack(); } else { - return new SWItem(Material.REDSTONE, ColorConfig.BASE + "Freeze: " + ColorConfig.HIGHLIGHT + "Ausgeschaltet").getItemStack(); + return new SWItem(Material.REDSTONE, BauSystem.MESSAGE.parse("REGION_ITEM_FREEZE_DISALLOW", player)).getItemStack(); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java index cb8d10c8..ae4b6bdb 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ProtectBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.flagvalues.ProtectMode; @@ -44,9 +44,9 @@ public class ProtectBauGuiItem extends BauGuiItem { public ItemStack getItem(Player player) { Region region = Region.getRegion(player.getLocation()); if (region.getPlain(Flag.PROTECT, ProtectMode.class) == ProtectMode.ACTIVE) { - return new SWItem(Material.OBSIDIAN, ColorConfig.BASE + "Protect: " + ColorConfig.HIGHLIGHT + "Eingeschaltet").getItemStack(); + return new SWItem(Material.OBSIDIAN, BauSystem.MESSAGE.parse("REGION_ITEM_PROTECT_ALLOW", player)).getItemStack(); } else { - return new SWItem(Material.STONE, ColorConfig.BASE + "Protect: " + ColorConfig.HIGHLIGHT + "Ausgeschaltet").getItemStack(); + return new SWItem(Material.STONE, BauSystem.MESSAGE.parse("REGION_ITEM_PROTECT_DISALLOW", player)).getItemStack(); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java index cfb38480..d6cb05d9 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/ResetBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.SWItem; import de.steamwar.inventory.SWListInv; import de.steamwar.sql.Schematic; @@ -45,7 +45,7 @@ public class ResetBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.HEAVY_WEIGHTED_PRESSURE_PLATE, ColorConfig.HIGHLIGHT + "Reset").getItemStack(); + return new SWItem(Material.HEAVY_WEIGHTED_PRESSURE_PLATE, BauSystem.MESSAGE.parse("REGION_ITEM_RESET", player)).getItemStack(); } @Override @@ -66,7 +66,7 @@ public class ResetBauGuiItem extends BauGuiItem { }); schemList.add(new SWListInv.SWListEntry<>(item, schem)); } - SWListInv inv = new SWListInv<>(p, "Reset Prototypen wählen", schemList, (clickType, schematic) -> { + SWListInv inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("REGION_ITEM_RESET_TITLE", p), schemList, (clickType, schematic) -> { p.closeInventory(); p.performCommand("reset " + schematic.getSchemName()); }); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java index 4d16dbb4..5c00d970 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TestblockBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.SWItem; import de.steamwar.inventory.SWListInv; import de.steamwar.sql.Schematic; @@ -45,7 +45,7 @@ public class TestblockBauGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.END_STONE, ColorConfig.HIGHLIGHT + "Testblock").getItemStack(); + return new SWItem(Material.END_STONE, BauSystem.MESSAGE.parse("REGION_ITEM_TESTBLOCK", player)).getItemStack(); } @Override @@ -67,7 +67,7 @@ public class TestblockBauGuiItem extends BauGuiItem { }); schemList.add(new SWListInv.SWListEntry<>(item, schem)); } - SWListInv inv = new SWListInv<>(p, "Testblock wählen", schemList, (clickType, schematic) -> { + SWListInv inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("REGION_ITEM_TESTBLOCK_TITLE", p), schemList, (clickType, schematic) -> { p.closeInventory(); p.performCommand("testblock " + schematic.getSchemName()); }); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java index 5261d499..678da86a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/region/items/TntBauGuiItem.java @@ -19,11 +19,11 @@ package de.steamwar.bausystem.features.region.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.bausystem.region.Region; import de.steamwar.bausystem.region.flags.Flag; import de.steamwar.bausystem.region.flags.flagvalues.TNTMode; @@ -45,11 +45,11 @@ public class TntBauGuiItem extends BauGuiItem { public ItemStack getItem(Player player) { switch (Region.getRegion(player.getLocation()).getPlain(Flag.TNT, TNTMode.class)) { case DENY: - return new SWItem(Material.MINECART, ColorConfig.BASE + "TNT: " + ColorConfig.HIGHLIGHT + "Ausgeschaltet").getItemStack(); + return new SWItem(Material.MINECART, BauSystem.MESSAGE.parse("REGION_ITEM_TNT_OFF", player)).getItemStack(); case ONLY_TB: - return new SWItem(Material.TNT_MINECART, ColorConfig.BASE + "TNT: " + ColorConfig.HIGHLIGHT + "nur Testblock").getItemStack(); + return new SWItem(Material.TNT_MINECART, BauSystem.MESSAGE.parse("REGION_ITEM_TNT_ONLY_TB", player)).getItemStack(); default: - return new SWItem(Material.TNT, ColorConfig.BASE + "TNT: " + ColorConfig.HIGHLIGHT + "Eingeschaltet").getItemStack(); + return new SWItem(Material.TNT, BauSystem.MESSAGE.parse("REGION_ITEM_TNT_ON", player)).getItemStack(); } } @@ -68,18 +68,18 @@ public class TntBauGuiItem extends BauGuiItem { } } else { p.closeInventory(); - SWInventory selector = new SWInventory(p, 9, "Tnt Modus"); - selector.setItem(1, new SWItem(Material.TNT, ColorConfig.HIGHLIGHT + "Einschalten", clickType -> { + SWInventory selector = new SWInventory(p, 9, BauSystem.MESSAGE.parse("REGION_ITEM_SELECTOR_TITLE", p)); + selector.setItem(1, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("REGION_ITEM_SELECTOR_ON", p), clickType -> { updateTntMode(TNTMode.ALLOW, p); p.closeInventory(); })); if (!Region.getRegion(p.getLocation()).isGlobal()) { - selector.setItem(4, new SWItem(Material.TNT_MINECART, ColorConfig.HIGHLIGHT + "nur Testblock", clickType -> { + selector.setItem(4, new SWItem(Material.TNT_MINECART, BauSystem.MESSAGE.parse("REGION_ITEM_SELECTOR_ONLY_TB", p), clickType -> { updateTntMode(TNTMode.ONLY_TB, p); p.closeInventory(); })); } - selector.setItem(7, new SWItem(Material.MINECART, ColorConfig.HIGHLIGHT + "Ausschalten", clickType -> { + selector.setItem(7, new SWItem(Material.MINECART, BauSystem.MESSAGE.parse("REGION_ITEM_SELECTOR_OFF", p), clickType -> { updateTntMode(TNTMode.DENY, p); p.closeInventory(); }));