Skip to content

Commit

Permalink
Fixed issue with one page /help
Browse files Browse the repository at this point in the history
  • Loading branch information
VoidemLIVE committed May 5, 2024
1 parent b7c4d94 commit 166a0c8
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.greenwoodmc</groupId>
<artifactId>HelpCommand</artifactId>
<version>2.8.2</version>
<version>2.8.3</version>
<packaging>jar</packaging>

<name>HelpCommand</name>
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/net/greenwoodmc/helpcommand/commands/help.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a
}
} else {
// If no page number specified, send page 1
if ((enabledPages.contains(2)) || (args[0].equals("1"))) {
if (args.length > 0 && (enabledPages.contains(2) || args[0].equals("1"))) {
// If page 2 exists
ver = (String) config.getStringList("help.1").stream().collect(Collectors.joining("\n"));
if (papiInstalled) {
Expand All @@ -123,7 +123,11 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a
} else {
// If page 2 doesn't exist
ver = (String) config.getStringList("help.1").stream().collect(Collectors.joining("\n"));
ver2 = PlaceholderAPI.setPlaceholders(player, ver);
if (papiInstalled) {
ver2 = PlaceholderAPI.setPlaceholders(player, ver);
} else {
ver2 = ver;
}
player.sendMessage(TextUtil.color(ver2));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Main Help Command
######################################

version: "2.8.2" # DO NOT CHANGE THIS VALUE
version: "2.8.3" # DO NOT CHANGE THIS VALUE
updateCheck: true # recommended to keep this value as true

help:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: HelpCommand
version: '2.8.2-PublicRelease'
version: '2.8.3-PublicRelease'
main: net.greenwoodmc.helpcommand.HelpCommand
api-version: 1.18
authors: [ VoidemLIVE ]
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion target/classes/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Main Help Command
######################################

version: "2.8.2" # DO NOT CHANGE THIS VALUE
version: "2.8.3" # DO NOT CHANGE THIS VALUE
updateCheck: true # recommended to keep this value as true

help:
Expand Down
Binary file modified target/classes/net/greenwoodmc/helpcommand/commands/help.class
Binary file not shown.
2 changes: 1 addition & 1 deletion target/classes/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: HelpCommand
version: '2.8.2-PublicRelease'
version: '2.8.3-PublicRelease'
main: net.greenwoodmc.helpcommand.HelpCommand
api-version: 1.18
authors: [ VoidemLIVE ]
Expand Down
2 changes: 1 addition & 1 deletion target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
artifactId=HelpCommand
groupId=net.greenwoodmc
version=2.8.2
version=2.8.3
Binary file not shown.

0 comments on commit 166a0c8

Please sign in to comment.