From 67822c0a8e9196d2fd4eef9a7e537420b47ac3dd Mon Sep 17 00:00:00 2001 From: David Hermann Date: Sat, 28 Jan 2023 13:18:56 +0100 Subject: [PATCH 1/3] refactoring: Deleted unused imports --- src/main/java/org/bitbiome/classes/JsonParser.java | 2 -- src/main/java/org/bitbiome/commands/HelpCommand.java | 4 ++-- src/main/java/org/bitbiome/commands/TravelCommand.java | 2 +- src/main/java/org/bitbiome/entities/Player.java | 2 +- src/test/java/org/bitbiome/commands/HelpCommandTest.java | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/bitbiome/classes/JsonParser.java b/src/main/java/org/bitbiome/classes/JsonParser.java index 0eb23d5..45111ef 100644 --- a/src/main/java/org/bitbiome/classes/JsonParser.java +++ b/src/main/java/org/bitbiome/classes/JsonParser.java @@ -2,12 +2,10 @@ package org.bitbiome.classes; import org.json.JSONObject; import org.json.JSONTokener; -import org.json.JSONWriter; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; -import java.io.StringWriter; diff --git a/src/main/java/org/bitbiome/commands/HelpCommand.java b/src/main/java/org/bitbiome/commands/HelpCommand.java index 90702cc..ee4f237 100644 --- a/src/main/java/org/bitbiome/commands/HelpCommand.java +++ b/src/main/java/org/bitbiome/commands/HelpCommand.java @@ -1,10 +1,10 @@ package org.bitbiome.commands; -import org.bitbiome.Boot; + import org.bitbiome.classes.Colors; import org.bitbiome.classes.TravelEngine; -import java.util.HashMap; + import java.util.Scanner; public class HelpCommand implements CommandAPI { diff --git a/src/main/java/org/bitbiome/commands/TravelCommand.java b/src/main/java/org/bitbiome/commands/TravelCommand.java index ca68bf5..da5cbe7 100644 --- a/src/main/java/org/bitbiome/commands/TravelCommand.java +++ b/src/main/java/org/bitbiome/commands/TravelCommand.java @@ -1,7 +1,7 @@ package org.bitbiome.commands; import org.bitbiome.classes.Colors; -import org.bitbiome.classes.CreateLocations; + import org.bitbiome.classes.TravelEngine; import org.bitbiome.entities.Item; import org.bitbiome.entities.Location; diff --git a/src/main/java/org/bitbiome/entities/Player.java b/src/main/java/org/bitbiome/entities/Player.java index 6fe3152..ff8dffb 100644 --- a/src/main/java/org/bitbiome/entities/Player.java +++ b/src/main/java/org/bitbiome/entities/Player.java @@ -1,6 +1,6 @@ package org.bitbiome.entities; -import org.bitbiome.classes.CreateLocations; + import org.bitbiome.classes.JsonParser; import java.util.ArrayList; diff --git a/src/test/java/org/bitbiome/commands/HelpCommandTest.java b/src/test/java/org/bitbiome/commands/HelpCommandTest.java index dab4d90..5caac07 100644 --- a/src/test/java/org/bitbiome/commands/HelpCommandTest.java +++ b/src/test/java/org/bitbiome/commands/HelpCommandTest.java @@ -3,7 +3,7 @@ package org.bitbiome.commands; import org.bitbiome.classes.Colors; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; + public class HelpCommandTest { From c7b8855442a315e34ba71f46e954020f897d0199 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Sat, 28 Jan 2023 13:29:02 +0100 Subject: [PATCH 2/3] refactoring: Language change, added color When a command is unkown, the language is now german and the message is red. --- src/main/java/org/bitbiome/classes/InteractionLoop.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index 2523644..d5c4c98 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -3,6 +3,8 @@ package org.bitbiome.classes; import org.bitbiome.Boot; import org.json.JSONObject; import java.util.Scanner; +import org.bitbiome.classes.Colors; + public class InteractionLoop { @@ -23,7 +25,7 @@ public class InteractionLoop { while (isRunning) { String line = input.nextLine().toLowerCase(); if (!Boot.instance.getCmdListener().perform(line.toLowerCase().split(" ")[0], input, isRunning, line, travelEngine)) { - System.out.println("Unknown Command"); + System.out.println(Colors.ANSI_RED + "Unbekannter Befehl - Siehe " + Colors.ANSI_PURPLE + "help\n" + Colors.ANSI_RESET); } } } From d09e3b1c2dd3497cfede95753332600562ed0964 Mon Sep 17 00:00:00 2001 From: David Hermann Date: Sat, 28 Jan 2023 13:33:21 +0100 Subject: [PATCH 3/3] refactoring: Removed unused imports --- src/main/java/org/bitbiome/classes/InteractionLoop.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/bitbiome/classes/InteractionLoop.java b/src/main/java/org/bitbiome/classes/InteractionLoop.java index d5c4c98..a0b5017 100644 --- a/src/main/java/org/bitbiome/classes/InteractionLoop.java +++ b/src/main/java/org/bitbiome/classes/InteractionLoop.java @@ -3,7 +3,6 @@ package org.bitbiome.classes; import org.bitbiome.Boot; import org.json.JSONObject; import java.util.Scanner; -import org.bitbiome.classes.Colors; public class InteractionLoop {