From e4abd226fc04939a1e68c4d0d7e7b7d0831fbd21 Mon Sep 17 00:00:00 2001 From: Tanja Herche Date: Sun, 5 Feb 2023 17:47:13 +0100 Subject: [PATCH] refactoring: created String for integrated Location Wueste --- src/main/java/org/bitbiome/commands/MapCommand.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bitbiome/commands/MapCommand.java b/src/main/java/org/bitbiome/commands/MapCommand.java index f65558d..6ef6e7f 100644 --- a/src/main/java/org/bitbiome/commands/MapCommand.java +++ b/src/main/java/org/bitbiome/commands/MapCommand.java @@ -15,6 +15,7 @@ public class MapCommand implements CommandAPI{ public static String getMapMessage(TravelEngine travelEngine) { StringBuilder outputMessage = new StringBuilder(); JSONArray locations = travelEngine.getLocationList(); + String locationWueste = locations.getJSONObject(5).getString("name"); if (travelEngine.getPlayer().getLocation().getName().equalsIgnoreCase("Wald")) { outputMessage .append(Colors.ANSI_BLUE + getLocationMessage(travelEngine) + "\n" + Colors.ANSI_RESET + "Zu den " + Colors.ANSI_BLUE + "blau " + Colors.ANSI_RESET + "markierten Standorten kannst du reisen\n" + Colors.ANSI_RESET) @@ -22,7 +23,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_BRIGHT_BLACK + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n") @@ -37,7 +38,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_BLUE + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_BLUE + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n") @@ -53,7 +54,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_BRIGHT_BLACK + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n") @@ -69,7 +70,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_GREEN + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_GREEN + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n") @@ -85,7 +86,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_BLUE + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_BLUE + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n") @@ -101,7 +102,7 @@ public class MapCommand implements CommandAPI{ .append(" __________________________________________________________________________________________________\n") .append("| | | |\n") .append("| | | |\n") - .append("| " + Colors.ANSI_BRIGHT_BLACK + locations.getJSONObject(5).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") + .append("| " + Colors.ANSI_BRIGHT_BLACK + locationWueste + Colors.ANSI_RESET + " | " + Colors.ANSI_BLUE + locations.getJSONObject(4).getString("name") + Colors.ANSI_RESET + " | " + Colors.ANSI_GREEN + locations.getJSONObject(2).getString("name") + Colors.ANSI_RESET + " |" + "\n") .append("| | | |\n") .append("|________________________________|________________________________|________________________________|\n") .append("| | | |\n")