aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/commands/help
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-27 11:53:57 -0500
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-02-27 11:53:57 -0500
commitb09f774d422263ce15b97d6d0804beddf856176d (patch)
treee542258481d7496b15679f3c329ef9e087c7d8fc /src/main/java/io/github/moulberry/notenoughupdates/commands/help
parent22cb02adbeb24b7ec98f843bcaba99cebe3e4f03 (diff)
downloadnotenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.gz
notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.tar.bz2
notenoughupdates-b09f774d422263ce15b97d6d0804beddf856176d.zip
feat: improve formating :)
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/commands/help')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java60
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java113
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.java33
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.java31
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/help/StorageViewerWhyCommand.java29
5 files changed, 144 insertions, 122 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java
index 53757985..593f2575 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/FeaturesCommand.java
@@ -16,33 +16,43 @@ import java.net.URI;
import java.net.URISyntaxException;
public class FeaturesCommand extends ClientCommandBase {
- public FeaturesCommand() {
- super("neufeatures");
- }
+ public FeaturesCommand() {
+ super("neufeatures");
+ }
- @Override
- public void processCommand(ICommandSender sender, String[] args) throws CommandException {
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- if (Constants.MISC == null || !Constants.MISC.has("featureslist")) {
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + "WARNING: " + EnumChatFormatting.RESET + EnumChatFormatting.RED + "Could not load URL from repo."));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("" + EnumChatFormatting.RED + "Please run " + EnumChatFormatting.BOLD + "/neuresetrepo" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " and " + EnumChatFormatting.BOLD + "restart your game" + EnumChatFormatting.RESET + EnumChatFormatting.RED + " in order to fix. " + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + "If that doesn't fix it" + EnumChatFormatting.RESET + EnumChatFormatting.RED + ", please join discord.gg/moulberry and post in #neu-support"));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- return;
- }
- String url = Constants.MISC.get("featureslist").getAsString();
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ if (Constants.MISC == null || !Constants.MISC.has("featureslist")) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ "" + EnumChatFormatting.DARK_RED + EnumChatFormatting.BOLD + "WARNING: " + EnumChatFormatting.RESET +
+ EnumChatFormatting.RED + "Could not load URL from repo."));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ "" + EnumChatFormatting.RED + "Please run " + EnumChatFormatting.BOLD + "/neuresetrepo" +
+ EnumChatFormatting.RESET + EnumChatFormatting.RED + " and " + EnumChatFormatting.BOLD + "restart your game" +
+ EnumChatFormatting.RESET + EnumChatFormatting.RED + " in order to fix. " + EnumChatFormatting.DARK_RED +
+ EnumChatFormatting.BOLD + "If that doesn't fix it" + EnumChatFormatting.RESET + EnumChatFormatting.RED +
+ ", please join discord.gg/moulberry and post in #neu-support"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ return;
+ }
+ String url = Constants.MISC.get("featureslist").getAsString();
- Desktop desk = Desktop.getDesktop();
- try {
- desk.browse(new URI(url));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "> Opening Feature List in browser."));
- } catch (URISyntaxException | IOException ignored) {
+ Desktop desk = Desktop.getDesktop();
+ try {
+ desk.browse(new URI(url));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET +
+ EnumChatFormatting.GOLD + "> Opening Feature List in browser."));
+ } catch (URISyntaxException | IOException ignored) {
- ChatComponentText clickTextFeatures = new ChatComponentText(
- EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET + EnumChatFormatting.GOLD + "> Click here to open the Feature List in your browser.");
- clickTextFeatures.setChatStyle(Utils.createClickStyle(ClickEvent.Action.OPEN_URL, url));
- Minecraft.getMinecraft().thePlayer.addChatMessage(clickTextFeatures);
+ ChatComponentText clickTextFeatures = new ChatComponentText(
+ EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.BOLD + "NEU" + EnumChatFormatting.RESET +
+ EnumChatFormatting.GOLD + "> Click here to open the Feature List in your browser.");
+ clickTextFeatures.setChatStyle(Utils.createClickStyle(ClickEvent.Action.OPEN_URL, url));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(clickTextFeatures);
- }
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- }
+ }
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ }
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java
index ade2dba1..9669be60 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java
@@ -9,62 +9,71 @@ import net.minecraft.command.ICommandSender;
import net.minecraft.util.ChatComponentText;
import java.util.ArrayList;
+import java.util.List;
public class HelpCommand extends ClientCommandBase {
- public HelpCommand() {
- super("neuhelp");
- }
+ public HelpCommand() {
+ super("neuhelp");
+ }
- @Override
- public void processCommand(ICommandSender sender, String[] args) {
- ArrayList<String> neuHelpMessages = Lists.newArrayList(
- "\u00a75\u00a7lNotEnoughUpdates commands",
- "\u00a76/neu \u00a77- Opens the main neu GUI.",
- "\u00a76/pv \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer",
- "\u00a76/neusouls {on/off/clear/unclear} \u00a7r\u00a77- Shows waypoints to fairy souls.",
- "\u00a76/neubuttons \u00a7r\u00a77- Opens a GUI which allows you to customize inventory buttons.",
- "\u00a76/neuec \u00a7r\u00a77- Opens the enchant colour GUI.",
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) {
+ ArrayList<String> neuHelpMessages = Lists.newArrayList(
+ "\u00a75\u00a7lNotEnoughUpdates commands",
+ "\u00a76/neu \u00a77- Opens the main neu GUI.",
+ "\u00a76/pv \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer",
+ "\u00a76/neusouls {on/off/clear/unclear} \u00a7r\u00a77- Shows waypoints to fairy souls.",
+ "\u00a76/neubuttons \u00a7r\u00a77- Opens a GUI which allows you to customize inventory buttons.",
+ "\u00a76/neuec \u00a7r\u00a77- Opens the enchant colour GUI.",
+ "\u00a76/join {floor} \u00a7r\u00a77- Short Command to join a Dungeon. \u00a7lNeed a Party of 5 People\u00a7r\u00a77 {4/f7/m5}.",
+ "\u00a76/neucosmetics \u00a7r\u00a77- Opens the cosmetic GUI.",
+ "\u00a76/neurename \u00a7r\u00a77- Opens the NEU Item Customizer.",
+ "\u00a76/cata \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer's catacombs page.",
+ "\u00a76/neulinks \u00a7r\u00a77- Shows links to neu/moulberry.",
+ "\u00a76/neuoverlay \u00a7r\u00a77- Opens GUI Editor for quickcommands and searchbar.",
+ "\u00a76/neuah \u00a7r\u00a77- Opens neu's custom ah GUI.",
+ "\u00a76/neumap \u00a7r\u00a77- Opens the dungeon map GUI.",
+ "\u00a76/neucalendar \u00a7r\u00a77- Opens neu's custom calendar GUI.",
+ "",
+ "\u00a76\u00a7lOld commands:",
+ "\u00a76/peek \u00a7b?{user} \u00a72\u2D35 \u00a7r\u00a77- Shows quickly stats for a user.",
+ "",
+ "\u00a76\u00a7lDebug commands:",
+ "\u00a76/neustats \u00a7r\u00a77- Copies helpful info to the clipboard.",
+ "\u00a76/neustats modlist \u00a7r\u00a77- Copies modlist info to clipboard.",
+ "\u00a76/neuresetrepo \u00a7r\u00a77- Deletes all repo files.",
+ "\u00a76/neureloadrepo \u00a7r\u00a77- Debug command with repo.",
+ "",
+ "\u00a76\u00a7lDev commands:",
+ "\u00a76/neupackdev \u00a7r\u00a77- pack creator command - getnpc"
+ );
+ for (String neuHelpMessage : neuHelpMessages) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuHelpMessage));
+ }
+ if (NotEnoughUpdates.INSTANCE.config.hidden.dev) {
+ ArrayList<String> neuDevHelpMessages = Lists.newArrayList(
+ "\u00a76/neudevtest \u00a7r\u00a77- dev test command",
+ "\u00a76/neuzeephere \u00a7r\u00a77- sphere",
+ "\u00a76/neudungeonwintest \u00a7r\u00a77- displays the dungeon win screen"
+ );
- "\u00a76/join {floor} \u00a7r\u00a77- Short Command to join a Dungeon. \u00a7lNeed a Party of 5 People\u00a7r\u00a77 {4/f7/m5}.",
- "\u00a76/neucosmetics \u00a7r\u00a77- Opens the cosmetic GUI.",
- "\u00a76/neurename \u00a7r\u00a77- Opens the NEU Item Customizer.",
- "\u00a76/cata \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer's catacombs page.",
- "\u00a76/neulinks \u00a7r\u00a77- Shows links to neu/moulberry.",
- "\u00a76/neuoverlay \u00a7r\u00a77- Opens GUI Editor for quickcommands and searchbar.",
- "\u00a76/neuah \u00a7r\u00a77- Opens neu's custom ah GUI.",
- "\u00a76/neumap \u00a7r\u00a77- Opens the dungeon map GUI.",
- "\u00a76/neucalendar \u00a7r\u00a77- Opens neu's custom calendar GUI.",
- "",
- "\u00a76\u00a7lOld commands:",
- "\u00a76/peek \u00a7b?{user} \u00a72\u2D35 \u00a7r\u00a77- Shows quickly stats for a user.",
- "",
- "\u00a76\u00a7lDebug commands:",
- "\u00a76/neustats \u00a7r\u00a77- Copies helpful info to the clipboard.",
- "\u00a76/neustats modlist \u00a7r\u00a77- Copies modlist info to clipboard.",
- "\u00a76/neuresetrepo \u00a7r\u00a77- Deletes all repo files.",
- "\u00a76/neureloadrepo \u00a7r\u00a77- Debug command with repo.",
- "",
- "\u00a76\u00a7lDev commands:",
- "\u00a76/neupackdev \u00a7r\u00a77- pack creator command - getnpc");
- for (String neuHelpMessage : neuHelpMessages) {
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuHelpMessage));
- }
- if (NotEnoughUpdates.INSTANCE.config.hidden.dev) {
- ArrayList<String> neuDevHelpMessages = Lists.newArrayList(
- "\u00a76/neudevtest \u00a7r\u00a77- dev test command",
- "\u00a76/neuzeephere \u00a7r\u00a77- sphere",
- "\u00a76/neudungeonwintest \u00a7r\u00a77- displays the dungeon win screen");
+ for (String neuDevHelpMessage : neuDevHelpMessages) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuDevHelpMessage));
+ }
+ }
+ String[] helpInfo = {
+ "",
+ "\u00a77Commands marked with a \u00a72\"\u2D35\"\u00a77 require are api key. You can set your api key via \"/api new\" or by manually putting it in the api field in \"/neu\"",
+ "",
+ "\u00a77Arguments marked with a \u00a7b\"?\"\u00a77 are optional.",
+ "",
+ "\u00a76\u00a7lScroll up to see everything"
+ };
- for (String neuDevHelpMessage : neuDevHelpMessages) {
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(neuDevHelpMessage));
- }
- }
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a77Commands marked with a \u00a72\"\u2D35\"\u00a77 require are api key. You can set your api key via \"/api new\" or by manually putting it in the api field in \"/neu\""));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a77Arguments marked with a \u00a7b\"?\"\u00a77 are optional."));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("\u00a76\u00a7lScroll up to see everything"));
- }
+ for (String message : helpInfo) {
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(message));
+ }
+
+ }
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.java
index a8f0a2c8..c81f44a8 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/LinksCommand.java
@@ -12,22 +12,23 @@ import java.io.File;
public class LinksCommand extends ClientCommandBase {
- public LinksCommand() {
- super("neulinks");
- }
+ public LinksCommand() {
+ super("neulinks");
+ }
- @Override
- public void processCommand(ICommandSender sender, String[] args) throws CommandException {
- File repo = NotEnoughUpdates.INSTANCE.manager.repoLocation;
- if (repo.exists()) {
- File updateJson = new File(repo, "update.json");
- try {
- JsonObject update = NotEnoughUpdates.INSTANCE.manager.getJsonFromFile(updateJson);
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ File repo = NotEnoughUpdates.INSTANCE.manager.repoLocation;
+ if (repo.exists()) {
+ File updateJson = new File(repo, "update.json");
+ try {
+ JsonObject update = NotEnoughUpdates.INSTANCE.manager.getJsonFromFile(updateJson);
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- NotEnoughUpdates.INSTANCE.displayLinks(update);
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
- } catch (Exception ignored) {}
- }
- }
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ NotEnoughUpdates.INSTANCE.displayLinks(update);
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
+ } catch (Exception ignored) {
+ }
+ }
+ }
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.java
index 7db8c468..08350be9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/SettingsCommand.java
@@ -13,21 +13,22 @@ import java.util.List;
public class SettingsCommand extends ClientCommandBase {
- public SettingsCommand() {
- super("neu");
- }
+ public SettingsCommand() {
+ super("neu");
+ }
- @Override
- public List<String> getCommandAliases() {
- return Arrays.asList("neusettings", "neuconfig");
- }
+ @Override
+ public List<String> getCommandAliases() {
+ return Arrays.asList("neusettings", "neuconfig");
+ }
- @Override
- public void processCommand(ICommandSender sender, String[] args) throws CommandException {
- if (args.length > 0) {
- NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, StringUtils.join(args, " ")));
- } else {
- NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(NEUConfigEditor.editor);
- }
- }
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) throws CommandException {
+ if (args.length > 0) {
+ NotEnoughUpdates.INSTANCE.openGui =
+ new GuiScreenElementWrapper(new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, StringUtils.join(args, " ")));
+ } else {
+ NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(NEUConfigEditor.editor);
+ }
+ }
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/StorageViewerWhyCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/StorageViewerWhyCommand.java
index b3cc8b2f..4f85c26e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/StorageViewerWhyCommand.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/StorageViewerWhyCommand.java
@@ -7,19 +7,20 @@ import net.minecraft.command.ICommandSender;
public class StorageViewerWhyCommand extends ClientCommandBase {
- public StorageViewerWhyCommand() {
- super("neustwhy");
- }
+ public StorageViewerWhyCommand() {
+ super("neustwhy");
+ }
- @Override
- public void processCommand(ICommandSender sender, String[] args) {
- NEUEventListener.displayNotification(Lists.newArrayList(
- "\u00a7eStorage Viewer",
- "\u00a77Currently, the storage viewer requires you to click twice",
- "\u00a77in order to switch between pages. This is because Hypixel",
- "\u00a77has not yet added a shortcut command to go to any enderchest/",
- "\u00a77storage page.",
- "\u00a77While it is possible to send the second click",
- "\u00a77automatically, doing so violates Hypixel's new mod rules."), true);
- }
+ @Override
+ public void processCommand(ICommandSender sender, String[] args) {
+ NEUEventListener.displayNotification(Lists.newArrayList(
+ "\u00a7eStorage Viewer",
+ "\u00a77Currently, the storage viewer requires you to click twice",
+ "\u00a77in order to switch between pages. This is because Hypixel",
+ "\u00a77has not yet added a shortcut command to go to any enderchest/",
+ "\u00a77storage page.",
+ "\u00a77While it is possible to send the second click",
+ "\u00a77automatically, doing so violates Hypixel's new mod rules."
+ ), true);
+ }
}