aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErymanthus[#5074] | (u/)RayDeeUx <51521765+RayDeeUx@users.noreply.github.com>2023-10-20 09:57:01 -0400
committerGitHub <noreply@github.com>2023-10-20 22:57:01 +0900
commit03eb1c64fce49454fa1cf90be015fa0be7064a57 (patch)
tree4bc336b0b9e8c984240297b5e4548e55ac549804
parent4a38331c9742a39348e0c21dd861314b19fcf391 (diff)
downloadSkyblock-Dungeons-Guide-03eb1c64fce49454fa1cf90be015fa0be7064a57.tar.gz
Skyblock-Dungeons-Guide-03eb1c64fce49454fa1cf90be015fa0be7064a57.tar.bz2
Skyblock-Dungeons-Guide-03eb1c64fce49454fa1cf90be015fa0be7064a57.zip
Feature: Per #400, add command alias "dungeonsguide". Also added "dungeonguide" since everyone keeps forgetting plural (#428)
* add alias per #400 * add alias per #400 (attempt #2) * add another alias * revise arraylist initalization * intellij is saying this import is unused. removed it * add justifications for aliases * swap "dg" and "dungeonsguide" * Revert "swap "dg" and "dungeonsguide"" This reverts commit 2ddbaf8f58d5d7937389909d96d5797c76c16639. * swap "dg" and "dungeonsguide" (for real this time)
-rw-r--r--mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java29
1 files changed, 26 insertions, 3 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java
index 74846206..1ea1cee1 100644
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDungeonsGuide.java
@@ -49,6 +49,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.json.JSONObject;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -56,12 +57,25 @@ public class CommandDungeonsGuide extends CommandBase {
@Override
public String getCommandName() {
- return "dg";
+ return "dungeonsguide";
}
@Override
public String getCommandUsage(ICommandSender sender) {
- return "dg";
+ return "dungeonsguide";
+ }
+
+ @Override
+ public List<String> getCommandAliases() {
+ return new ArrayList<String>() {{
+ add("dg"); //per issue #400
+ add("dungeonguide"); //because people keep saying "dungeon guide" the singular
+ add("deegee"); //in case another mod/server somehow uses a command "/dg" and no one wants to type out the entire name "dungeonsguide"
+ add("던전가이드"); //easter egg
+ add("던전안내"); //easter egg
+ // for each new alias, make a new line, then: add("[INSERT YOUR ALIAS HERE]");
+ // Shoutout to coobird for the anonymous inner class idea: stackoverflow.com/a/1005083
+ }};
}
//List of subcommands for tab support
@@ -76,7 +90,8 @@ public class CommandDungeonsGuide extends CommandBase {
"purge",
"pbroadcast",
"partymax",
- "unload"
+ "unload",
+ "aliases"
};
@Override
@@ -133,6 +148,14 @@ public class CommandDungeonsGuide extends CommandBase {
unloadCommand();
break;
+
+ case "aliases":
+ ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide aliases§7::"));
+ ChatTransmitter.addToQueue(new ChatComponentText(" §7- §e/dungeonsguide"));
+ ChatTransmitter.addToQueue(new ChatComponentText(" §7- §e/dungeonguide"));
+ ChatTransmitter.addToQueue(new ChatComponentText(" §7- §e/deegee"));
+ break;
+
default:
ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui"));
ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §e/dg gui §7-§fOpens configuration gui"));