Skip to content

Commit eb176b8

Browse files
committed
Change up help command a bit because Bukkit changes things
1 parent d5ab7ad commit eb176b8

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/main/java/net/earthcomputer/clientcommands/command/CommandCHelp.java

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ public class CommandCHelp extends ClientCommandBase {
2828
String message = e.getMessage();
2929
if (e.getMessage().startsWith("/")) {
3030
message = message.substring(1).trim();
31-
if (message.startsWith("help ")) {
32-
String[] args = message.split(" ");
33-
if (args.length > 1) {
31+
String[] args = message.split(" ");
32+
if ("help".equals(args[0])) {
33+
if (args.length == 1) {
34+
TextComponentTranslation chatMsg = new TextComponentTranslation("commands.chelp.helpHint");
35+
chatMsg.getStyle().setColor(TextFormatting.GREEN);
36+
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(chatMsg);
37+
} else {
3438
if (ClientCommandHandler.instance.getCommands().containsKey(args[1])) {
3539
TextComponentString hint = new TextComponentString("/chelp " + args[1]);
3640
hint.getStyle().setUnderlined(Boolean.TRUE);
@@ -47,16 +51,6 @@ public class CommandCHelp extends ClientCommandBase {
4751
}
4852
}
4953
});
50-
EventManager.addChatReceivedListener(e -> {
51-
if (e.getMessage() instanceof TextComponentTranslation) {
52-
String key = ((TextComponentTranslation) e.getMessage()).getKey();
53-
if ("commands.help.footer".equals(key)) {
54-
TextComponentTranslation message = new TextComponentTranslation("commands.chelp.helpHint");
55-
message.getStyle().setColor(TextFormatting.GREEN);
56-
Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(message);
57-
}
58-
}
59-
});
6054
}
6155

6256
@Override

0 commit comments

Comments
 (0)