From e1f77b47b35a77cdb87a8ea0a4ba12b9afa04206 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Thu, 13 May 2021 16:21:50 +0200 Subject: [PATCH] Add RecordStatus to multilingual --- BauSystem_Main/src/BauSystem.properties | 33 +++++++++++-------- .../bausystem/features/gui/BauGUICommand.java | 4 +-- .../gui/editor/BauGuiEditorGuiItem.java | 2 +- .../gui/editor/BauGuiImportExport.java | 6 ++-- .../other/items/TeleportBauGuiItem.java | 4 +-- .../features/tracer/TraceCommand.java | 2 +- .../features/tracer/TracerBauGuiItem.java | 14 ++++---- .../features/tracer/record/RecordStatus.java | 8 ++--- 8 files changed, 39 insertions(+), 34 deletions(-) diff --git a/BauSystem_Main/src/BauSystem.properties b/BauSystem_Main/src/BauSystem.properties index 83cb73c7..2a4d244f 100644 --- a/BauSystem_Main/src/BauSystem.properties +++ b/BauSystem_Main/src/BauSystem.properties @@ -88,25 +88,30 @@ REGION_TYPE_BUILD = Baubereich REGION_TYPE_ONLY_TB = Testblock # GUI -GUI_EDITOR_ITEM_NAME=§eGui Editor +GUI_EDITOR_ITEM-NAME=§eGui Editor GUI_EXPORT_CODE=§eDein Gui-Code: -GUI_EXPORT_CODE_HOVER=§eKopieren -GUI_IMPORT_INVALID_CODE=§eInvalieder Gui-Code -GUI_IMPORT_CODE_SUCCESSFUL=§eGui-Code eingelesen +GUI_EXPORT_CODE-HOVER=§eKopieren +GUI_IMPORT_INVALID-CODE=§eInvalieder Gui-Code +GUI_IMPORT_CODE-SUCCESSFUL=§eGui-Code eingelesen # Trace TRACE_RECORD = §aan -TRACE_RECORD_AUTO = §an +TRACE_RECORD-AUTO = §an TRACE_IDLE = §caus -TRACE_IDLE_AUTO = §eauto +TRACE_IDLE-AUTO = §eauto + +TRACE_MESSAGE-AUTO_RECORD = §cTNT-Tracer muss gestoppt werden +TRACE_MESSAGE-AUTO_RECORD-AUTO = §cTNT-Tracer darf nicht aufnehmen +TRACE_MESSAGE-AUTO_IDLE = §cAuto-Tracer gestoppt +TRACE_MESSAGE-AUTO_IDLE-AUTO = §aAuto-Tracer gestartet TRACE_GUI_NAME=Tracer Gui -TRACE_GUI_TRACE_INACTIVE=§eTracer Starten -TRACE_GUI_TRACE_ACTIVE=§eTracer Stoppen -TRACE_GUI_TRACE_ACTIVE_AUTO=§eAuto-Trace ist Aktiv -TRACE_GUI_AUTO_TRACE_INACTIVE=§eAuto-Tracer Aktivieren -TRACE_GUI_AUTO_TRACE_ACTIVE=§eAuto-Tracer Deaktivieren -TRACE_GUI_SHOW_GUI=§eTrace Show Gui +TRACE_GUI_TRACE-INACTIVE=§eTracer Starten +TRACE_GUI_TRACE-ACTIVE=§eTracer Stoppen +TRACE_GUI_TRACE-ACTIVE-AUTO=§eAuto-Trace ist Aktiv +TRACE_GUI_AUTO-TRACE-INACTIVE=§eAuto-Tracer Aktivieren +TRACE_GUI_AUTO-TRACE-ACTIVE=§eAuto-Tracer Deaktivieren +TRACE_GUI_SHOW-GUI=§eTrace Show Gui TRACE_GUI_DELETE=§eTrace Löschen # Loader @@ -132,5 +137,5 @@ LOADER_BUTTON_DAYLIGHTSENSOR = Tageslichtsensor LOADER_BUTTON_INVALID = Invalider # Other -OTHER_ITEMS_TELEPORT_GUI_NAME=Teleportieren -OTHER_ITEMS_TELEPORT_PLAYER_OFFLINE=§cDer Spieler ist Offline \ No newline at end of file +OTHER_ITEMS_TELEPORT_GUI-NAME=Teleportieren +OTHER_ITEMS_TELEPORT_PLAYER-OFFLINE=§cDer Spieler ist Offline \ No newline at end of file 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 66240010..620b9c09 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/BauGUICommand.java @@ -61,7 +61,7 @@ public class BauGUICommand extends SWCommand { TextComponent component = new TextComponent(); component.setColor(ColorConfig.HIGHLIGHT); component.setBold(true); - component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(BauSystem.MESSAGE.parse("GUI_EXPORT_CODE_HOVER", p)))); + 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)); component.setText(export); BauSystem.MESSAGE.send("GUI_EXPORT_CODE", p); @@ -71,7 +71,7 @@ public class BauGUICommand extends SWCommand { @Register("import") public void importGui(Player p, String code) { if (BauGuiImportExport.importGui(code, p)) { - BauSystem.MESSAGE.send("GUI_IMPORT_CODE_SUCCESSFUL", p); + BauSystem.MESSAGE.send("GUI_IMPORT_CODE-SUCCESSFUL", p); } } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditorGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditorGuiItem.java index 56eb6d8f..24797e67 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditorGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiEditorGuiItem.java @@ -44,7 +44,7 @@ public class BauGuiEditorGuiItem extends BauGuiItem { @Override public ItemStack getItem(Player player) { - return new SWItem(Material.IRON_PICKAXE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM_NAME", player)).getItemStack(); + return new SWItem(Material.IRON_PICKAXE, BauSystem.MESSAGE.parse("GUI_EDITOR_ITEM-NAME", player)).getItemStack(); } @Override diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java index 6c01ac03..2f1a3fd4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/gui/editor/BauGuiImportExport.java @@ -49,14 +49,14 @@ public class BauGuiImportExport { public static boolean importGui(String str, Player p) { byte[] bytes = Base64.getDecoder().decode(str); if (bytes.length % 2 != 1 || bytes.length < 2) { - BauSystem.MESSAGE.send("GUI_IMPORT_INVALID_CODE", p); + BauSystem.MESSAGE.send("GUI_IMPORT_INVALID-CODE", p); return false; } final int size = bytes[bytes.length - 1]; if (size > 9 * 5) { - BauSystem.MESSAGE.send("GUI_IMPORT_INVALID_CODE", p); + BauSystem.MESSAGE.send("GUI_IMPORT_INVALID-CODE", p); return false; } @@ -71,7 +71,7 @@ public class BauGuiImportExport { if (map.containsKey((int) key) || map.containsValue((int) value) || value >= size || key > itemSize) { - BauSystem.MESSAGE.send("GUI_IMPORT_INVALID_CODE", p); + BauSystem.MESSAGE.send("GUI_IMPORT_INVALID-CODE", p); return false; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java b/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java index 9dbcfa85..b090af7a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/other/items/TeleportBauGuiItem.java @@ -50,10 +50,10 @@ public class TeleportBauGuiItem extends BauGuiItem { @Override public boolean click(ClickType click, Player p) { p.closeInventory(); - SWListInv inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("OTHER_ITEMS_TELEPORT_GUI_NAME", p), SWListInv.createPlayerList(p.getUniqueId()), (clickType, o) -> { + SWListInv inv = new SWListInv<>(p, BauSystem.MESSAGE.parse("OTHER_ITEMS_TELEPORT_GUI-NAME", p), SWListInv.createPlayerList(p.getUniqueId()), (clickType, o) -> { Player t = Bukkit.getPlayer(o); if (t == null) { - BauSystem.MESSAGE.send("OTHER_ITEMS_TELEPORT_PLAYER_OFFLINE", p); + BauSystem.MESSAGE.send("OTHER_ITEMS_TELEPORT_PLAYER-OFFLINE", p); } else { p.performCommand("tp " + t.getName()); } 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 5da3971f..5544c997 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TraceCommand.java @@ -119,7 +119,7 @@ public class TraceCommand extends SWCommand { public void autoCommand(Player p) { if (!permissionCheck(p)) return; RecordStateMachine.commandAuto(); - p.sendMessage(BauSystem.PREFIX + RecordStateMachine.getRecordStatus().getAutoMessage()); + BauSystem.MESSAGE.send(RecordStateMachine.getRecordStatus().getAutoMessage(), p); } @Register({"clear"}) 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..c2e6d952 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TracerBauGuiItem.java @@ -55,36 +55,36 @@ public class TracerBauGuiItem extends BauGuiItem { SWInventory inv = new SWInventory(p, 9, BauSystem.MESSAGE.parse("TRACE_GUI_NAME", p)); if (status.isTracing()) { if (status.isAutoTrace()) { - inv.setItem(1, new SWItem(Material.GRAY_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE_ACTIVE_AUTO", p))); + inv.setItem(1, new SWItem(Material.GRAY_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE-ACTIVE-AUTO", p))); } else { - inv.setItem(1, new SWItem(Material.GREEN_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE_ACTIVE", p), clickType -> { + inv.setItem(1, new SWItem(Material.GREEN_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE-ACTIVE", p), clickType -> { p.performCommand("trace stop"); open(p); })); } } else { - inv.setItem(1, new SWItem(Material.RED_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE_INACTIVE", p), clickType -> { + inv.setItem(1, new SWItem(Material.RED_DYE, BauSystem.MESSAGE.parse("TRACE_GUI_TRACE-INACTIVE", p), clickType -> { p.performCommand("trace start"); open(p); })); } if (status.isAutoTrace()) { - inv.setItem(3, new SWItem(Material.ENDER_EYE, BauSystem.MESSAGE.parse("TRACE_GUI_AUTO_TRACE_ACTIVE", p), clickType -> { + inv.setItem(3, new SWItem(Material.ENDER_EYE, BauSystem.MESSAGE.parse("TRACE_GUI_AUTO-TRACE-ACTIVE", p), clickType -> { p.performCommand("trace auto"); open(p); })); } else { - inv.setItem(3, new SWItem(Material.FIREWORK_STAR, BauSystem.MESSAGE.parse("TRACE_GUI_AUTO_TRACE_INACTIVE", p), clickType -> { + inv.setItem(3, new SWItem(Material.FIREWORK_STAR, BauSystem.MESSAGE.parse("TRACE_GUI_AUTO-TRACE-INACTIVE", p), clickType -> { p.performCommand("trace auto"); open(p); })); } if (TraceShowManager.hasActiveShow(p)) { - inv.setItem(5, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("TRACE_GUI_SHOW_GUI", p), clickType -> { + inv.setItem(5, new SWItem(Material.TNT, BauSystem.MESSAGE.parse("TRACE_GUI_SHOW-GUI", p), clickType -> { p.performCommand("trace show gui"); })); } else { - inv.setItem(5, new SWItem(Material.GLASS, BauSystem.MESSAGE.parse("TRACE_GUI_SHOW_GUI", p), clickType -> { + inv.setItem(5, new SWItem(Material.GLASS, BauSystem.MESSAGE.parse("TRACE_GUI_SHOW-GUI", p), clickType -> { p.performCommand("trace show gui"); })); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/RecordStatus.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/RecordStatus.java index 95b33260..f5d37e2e 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/RecordStatus.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/record/RecordStatus.java @@ -21,10 +21,10 @@ package de.steamwar.bausystem.features.tracer.record; public enum RecordStatus { - RECORD("TRACE_RECORD", true, "§cTNT-Tracer muss gestoppt werden"), - RECORD_AUTO("TRACE_RECORD_AUTO", true, "§cTNT-Tracer darf nicht aufnehmen"), - IDLE("TRACE_IDLE", false, "§cAuto-Tracer gestoppt"), - IDLE_AUTO("TRACE_IDLE_AUTO", false, "§aAuto-Tracer gestartet"); + RECORD("TRACE_RECORD", true, "TRACE_MESSAGE-AUTO_RECORD"), + RECORD_AUTO("TRACE_RECORD-AUTO", true, "TRACE_MESSAGE-AUTO_RECORD-AUTO"), + IDLE("TRACE_IDLE", false, "TRACE_MESSAGE-AUTO_IDLE"), + IDLE_AUTO("TRACE_IDLE-AUTO", false, "TRACE_MESSAGE-AUTO_IDLE-AUTO"); String name; boolean tracing;