diff --git a/src/main/java/jesse/keeblarcraft/Commands/CustomCommandManager.java b/src/main/java/jesse/keeblarcraft/Commands/CustomCommandManager.java index e28c075..dce468b 100644 --- a/src/main/java/jesse/keeblarcraft/Commands/CustomCommandManager.java +++ b/src/main/java/jesse/keeblarcraft/Commands/CustomCommandManager.java @@ -19,7 +19,7 @@ public class CustomCommandManager { NoteCommands noteCommands = new NoteCommands(); // REGISTER COMMANDS BELOW - System.out.println("REGISTERING CUSTOM COMMAND EXTENSIONS BELOW"); + System.out.println("\033[32m REGISTERING CUSTOM COMMAND EXTENSIONS BELOW \033[0m"); shortcuts.RegisterShortcutCommands(); noteCommands.RegisterNoteCommands(); } diff --git a/src/main/java/jesse/keeblarcraft/Commands/NoteCommands.java b/src/main/java/jesse/keeblarcraft/Commands/NoteCommands.java index ff9f632..9a53275 100644 --- a/src/main/java/jesse/keeblarcraft/Commands/NoteCommands.java +++ b/src/main/java/jesse/keeblarcraft/Commands/NoteCommands.java @@ -31,15 +31,15 @@ public class NoteCommands { // Attempt to create the directory try { if (notesConfig.CreateDirectory(NOTES_GLOBAL_DIRECTORY) == true) { - System.out.println("Created notes directory successfully!"); //TODO: Success! + System.out.println("\033[32m Created notes directory successfully! \033[0m"); //TODO: Success! } else { - System.out.println("ERROR: Notes directory FAILED to create!! Either the directory already exists or we are missing permissions!"); //TODO: Critical failure + System.out.println("\033[35m ERROR: Notes directory FAILED to create!! Either the directory already exists or we are missing permissions! \033[0m"); //TODO: Critical failure --not specfic enough to mark it as a red or blue } } catch (DIRECTORY_CREATE_EXCEPTION e) { - System.out.println("Directory creation failed"); + System.out.println("\033[31m Directory creation failed \033[0m"); } } else { - System.out.println("Notes directory already exists. Skipping creation..."); //TODO: Success! + System.out.println("\033[34m Notes directory already exists. Skipping creation... \033[0m"); //TODO: Success! } } @@ -104,7 +104,7 @@ public class NoteCommands { ret = 0; } else { - System.out.println("Only a player can execute this command!"); + System.out.println("\033[31m Only a player can execute this command! \033[0m"); } return ret; diff --git a/src/main/java/jesse/keeblarcraft/Commands/ShortcutCommands.java b/src/main/java/jesse/keeblarcraft/Commands/ShortcutCommands.java index 7fd4b74..669a0ef 100644 --- a/src/main/java/jesse/keeblarcraft/Commands/ShortcutCommands.java +++ b/src/main/java/jesse/keeblarcraft/Commands/ShortcutCommands.java @@ -96,11 +96,11 @@ public class ShortcutCommands { } else { - player.sendMessage(Text.literal("You do not have permissions to run this command!")); + player.sendMessage(Text.literal("\033[31m You do not have permissions to run this command! \033[0m")); } } else { - System.out.println("This command cannot be executed by a non-player entity!"); + System.out.println("\033[31m This command cannot be executed by a non-player entity! \033[0m"); } return retValue; diff --git a/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java b/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java index c5cf80a..a2aca46 100644 --- a/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java +++ b/src/main/java/jesse/keeblarcraft/ConfigMgr/ConfigManager.java @@ -46,7 +46,7 @@ public class ConfigManager { // Check 1: Does the file already exist? ret = file.exists(); - System.out.println("Does file exist? " + (ret ? "YES" : "NO")); + System.out.println("\033[34m Does file exist? \033[0m" + (ret ? "\033[33m YES \033[0m" : "\033[31m NO \033[0m")); // Check 2: If the file does not exist, attempt to create it if (ret == false) { @@ -57,8 +57,8 @@ public class ConfigManager { throw new FILE_CREATE_EXCEPTION(); } } else { - ret = true; // This might be a hot fix, but technically the file already exists so would this be true or false? - System.out.println("File (name:" + fileName + ") was determined to already exist. Exiting out"); + ret = true; // This might be a hot fix, but technically the file already exists so would this be true or false? --?this statement is wild? + System.out.println("\033[34m File (name: \033[0m" + "\033[33m" + fileName + "\033[0m" + "\033[34m) was determined to already exist. Exiting out\033[0m"); } return ret; } @@ -81,7 +81,7 @@ public class ConfigManager { throw new FILE_DELETE_EXCEPTION(); } } else { - System.out.println("Cannot delete file " + fileName + " because file does not exist"); + System.out.println("\033[34m Cannot delete file \033[0m" + "\033[33m" + fileName + "\033[0m" + "\033[31m because file does not exist \033[0m"); } return ret; } @@ -105,13 +105,13 @@ public class ConfigManager { ret = true; break; default: - System.out.println("Invalid mode to WriteToFile!"); + System.out.println("\033[31m Invalid mode to WriteToFile! \033[0m"); break; } file.close(); } catch (IOException e) { - System.out.println("Could not open file " + fileName + " to write to it! Possibly permission issue?"); + System.out.println("\033[31m Could not open file \033[0m" + "\033[33m" + fileName + "\033[0m" + "\033[31m to write to it! Possibly permission issue? \033[0m"); } return ret; @@ -135,7 +135,7 @@ public class ConfigManager { writer.flush(); writer.close(); } catch (JsonIOException | IOException e) { - System.out.println("Could not successfully write to json file"); + System.out.println("\033[31m Could not successfully write to json file \033[0m"); throw new FILE_WRITE_EXCEPTION(); } } @@ -151,18 +151,18 @@ public class ConfigManager { // return value in the future - but for now throw JsonSyntaxException no matter what exception is caught try { File file = new File(fileName); - ret = FileUtils.readFileToString(file, "UTF-8"); + ret = FileUtils.readFileToString(file, "\033[32m UTF-8 \033[0m"); } catch (NullPointerException e) { - System.out.println("nullptr exception"); + System.out.println("\033[31m nullptr exception \033[0m"); throw new JsonSyntaxException(""); } catch (FileNotFoundException e) { - System.out.println("file not found"); + System.out.println("\033[31m file not found \033[0m"); throw new JsonSyntaxException(""); } catch (java.nio.charset.UnsupportedCharsetException e) { - System.out.println("charset issue"); + System.out.println("\033[31m charset issue \033[0m"); throw new JsonSyntaxException(""); } catch (IOException e) { - System.out.println("io exception"); + System.out.println("\033[31m io exception \033[0m"); throw new JsonSyntaxException(""); } @@ -191,7 +191,7 @@ public class ConfigManager { ret = dir.mkdirs(); } } catch (Exception e) { - System.out.println("Failed to make directory with name " + dirName); + System.out.println("\033[31m Failed to make directory with name: \033[0m" + "\033[33m" + dirName + "\033[0m"); ret = true; /// TODO: Hack to make Setup fn be fine with prev-created files! Make Setup more robust! throw new DIRECTORY_CREATE_EXCEPTION(); } @@ -205,9 +205,9 @@ public class ConfigManager { try { ret = dir.delete(); - System.out.println("Deleted directory " + dirName); + System.out.println("\033[32m Deleted directory \033[0m" + "\033[33m" + dirName + "\033[0m"); } catch (Exception e) { - System.out.println("Failed to delete directory " + dirName); + System.out.println("\033[31m Failed to delete directory: \033[0m" + "\033[33m" + dirName + "\033[0m"); throw new DIRECTORY_DELETE_EXCEPTION(); } diff --git a/src/main/java/jesse/keeblarcraft/JsonClassObjects/PlayerNote.java b/src/main/java/jesse/keeblarcraft/JsonClassObjects/PlayerNote.java index 99539fa..7970b4a 100644 --- a/src/main/java/jesse/keeblarcraft/JsonClassObjects/PlayerNote.java +++ b/src/main/java/jesse/keeblarcraft/JsonClassObjects/PlayerNote.java @@ -91,21 +91,21 @@ public class PlayerNote { // In the event the above code failed out, this means a new file has to be created for the player's uuid if (!existingFile) { - System.out.println("Trying to create new file"); + System.out.println("\033[34m Trying to create new file \033[0m"); try { thisNote.uuid = uuid; FlashConfig(); } catch (Exception e) { - System.out.println("Could not write to file"); + System.out.println("\033[31m Could not write to file \033[0m"); } } else { - System.out.println("Moving on"); + System.out.println("\033[34m Moving on \033[0m"); } // It's possible the above code will return a blank class if a file doesn't exist. This will make // a new file with this players uuid if ("".equals(thisNote.uuid)) { - System.out.println("Assigning new config file for this uuid. No previous existing"); + System.out.println("\033[32m Assigning new config file for this uuid. No previous existing \033[0m"); thisNote.uuid = uuid; } } @@ -142,7 +142,7 @@ public class PlayerNote { try { config.WriteToJsonFile("notes/" + thisNote.uuid.toString() + ".json", thisNote); } catch (FILE_WRITE_EXCEPTION e) { - System.out.println("Could not flash notes configuration file"); + System.out.println("\033[31m Could not flash notes configuration file \033[0m"); } } } diff --git a/src/main/java/jesse/keeblarcraft/Keeblarcraft.java b/src/main/java/jesse/keeblarcraft/Keeblarcraft.java index 856caa4..df1b729 100644 --- a/src/main/java/jesse/keeblarcraft/Keeblarcraft.java +++ b/src/main/java/jesse/keeblarcraft/Keeblarcraft.java @@ -36,25 +36,25 @@ public class Keeblarcraft implements ModInitializer { // This code runs as soon as Minecraft is in a mod-load-ready state. // However, some things (like resources) may still be uninitialized. // Proceed with mild caution. - LOGGER.info("Hello Fabric world!"); + LOGGER.info("\033[36m Hello Fabric world! \033[0m"); if (setup != null) { try { // Run setup. If setup fails; it throws SETUP_FAILED_EXCEPTION - LOGGER.info("Running setup stage"); + LOGGER.info("\033[34m Running setup stage \033[0m"); setup.RunSetup(); // Run command registrations from the command manager - LOGGER.info("Running command registration"); + LOGGER.info("\033[34m Running command registration \033[0m"); cmdMgr.RegisterCustomCommands(); } catch (SETUP_FAILED_EXCEPTION e) { - System.out.println("ERROR. Setup failed to initialize environment. Mod likely does not have read/write permissions inside area. Mod will now close out."); + System.out.println("\033[31m ERROR. Setup failed to initialize environment. Mod likely does not have read/write permissions inside area. Mod will now close out. \033[0m"); e.printStackTrace(); } } else { // Program exit. Dual definition of setup somehow happened! - System.out.println("Dual definition of singleton attempted! Out of order initialization? How did this even happen?"); + System.out.println("\033[35m Dual definition of singleton attempted! Out of order initialization? How did this even happen? \033[0m"); } } } \ No newline at end of file diff --git a/src/main/java/jesse/keeblarcraft/Utils/Setup.java b/src/main/java/jesse/keeblarcraft/Utils/Setup.java index f507612..e8a9395 100644 --- a/src/main/java/jesse/keeblarcraft/Utils/Setup.java +++ b/src/main/java/jesse/keeblarcraft/Utils/Setup.java @@ -35,7 +35,7 @@ public final class Setup { private static Setup static_inst; public Setup() { - System.out.println("Running system setup and checks..."); + System.out.println("\033[34m Running system setup and checks... \033[0m"); } // Returns the singleton object @@ -79,9 +79,9 @@ public final class Setup { // Create directory check try { has_write = conf.CreateDirectory("test_dir"); - System.out.println("test_dir created? " + (has_write ? "YES" : "NO")); + System.out.println("\033[32m test_dir created! has write: \033[0m" + (has_write ? "\033[33m YES \033[0m" : "\033[31m NO \033[0m")); } catch (DIRECTORY_CREATE_EXCEPTION e) { - System.out.println("Failed to create test directory or it already exists"); + System.out.println("\033[31m Failed to create test directory or it already exists \033[0m"); has_write = false; } @@ -98,7 +98,7 @@ public final class Setup { has_read = true; } } catch (Exception e) { - System.out.println("Failed to create or write to test dir file"); + System.out.println("\033[31m Failed to create or write to test dir file \033[0m"); has_read = false; } } @@ -109,12 +109,12 @@ public final class Setup { has_write = conf.DeleteFile("test_dir/test_note.txt"); has_write = conf.DeleteDirectory("test_dir"); } catch (Exception e) { - System.out.println("Lost access to writing mid-way"); + System.out.println("\033[31m Lost access to writing mid-way \033[0m"); has_write = false; } } - System.out.println("CHECKS DEBUG: Value of has_write: " + has_write + ". Value of has_read: " + has_read); + System.out.println("\033[34m CHECKS DEBUG: Value of has_write: \033[0m" + "\033[33m" + has_write + "\033[0m" + "\033[34m . Value of has_read: \033[0m" + "\033[33m" + has_read + "\033[0m"); return has_write && has_read; } @@ -132,9 +132,9 @@ public final class Setup { for (Integer i = 0; i < DIRECTORY_LIST.size(); i++) { if ( ! conf.DoesDirectoryExist(DIRECTORY_LIST.get(i))) { conf.CreateDirectory(DIRECTORY_LIST.get(i)); - System.out.println("Creating directory " + DIRECTORY_LIST.get(i) + "..."); + System.out.println("\033[32m Creating directory \033[0m" + "\033[33m" + DIRECTORY_LIST.get(i) + "\033[0m" + "\033[32m ... \033[0m"); } else { - System.out.println("Directory " + conf.DoesDirectoryExist(DIRECTORY_LIST.get(i)) + " already exists. Skipping..."); + System.out.println("\033[34m Directory \033[0m" + "\033[33m" + conf.DoesDirectoryExist(DIRECTORY_LIST.get(i)) + "\033[0m" + "\033[34m already exists. Skipping... \033[0m"); } } @@ -142,20 +142,20 @@ public final class Setup { for (Integer i = 0; i < FILE_LIST.size(); i++) { if ( ! conf.DoesFileExist(FILE_LIST.get(i))) { conf.CreateFile(FILE_LIST.get(i)); - System.out.println("Creating file " + FILE_LIST.get(i) + "..."); + System.out.println("\033[32m Creating file \033[0m" + "\033[33m" + FILE_LIST.get(i) + "\033[0m" + "\033[32m ... \033[0m"); } else { - System.out.println("File " + conf.DoesDirectoryExist(FILE_LIST.get(i)) + " already exists. Skipping..."); + System.out.println("\033[34m File \033[0m" + "\033[33m" + conf.DoesDirectoryExist(FILE_LIST.get(i)) + "\033[0m" + "\033[34m already exists. Skipping...\033[0m"); } } } catch (Exception e) { throw new SETUP_FAILED_EXCEPTION(); } } else { - System.out.println("RunChecks() failed in its process. This mod has deemed it does not have read or write privileges in its hosted area and will now exit."); + System.out.println("\033[31m RunChecks() failed in its process. This mod has deemed it does not have read or write privileges in its hosted area and will now exit. \033[0m"); throw new SETUP_FAILED_EXCEPTION(); } - System.out.println("DID SETUP COMPLETE SUCCESSFULLY? " + (ret ? "YES" : "NO")); + System.out.println("\033[34m DID SETUP COMPLETE SUCCESSFULLY? \033[0m" + (ret ? "\033[33m YES \033[0m" : "\033[31m NO \033[0m")); return ret; }