mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-10-06 10:37:29 +02:00
parent
b6e8c19a86
commit
7dd06b9d9b
@ -94,7 +94,7 @@ public class DefaultHelpCommand extends CompositeCommand {
|
|||||||
if (user.isPlayer()) {
|
if (user.isPlayer()) {
|
||||||
// Player. Check perms
|
// Player. Check perms
|
||||||
if (user.isOp() || user.hasPermission(parent.getPermission())) {
|
if (user.isOp() || user.hasPermission(parent.getPermission())) {
|
||||||
if (params.isEmpty()) {
|
if (params == null || params.isEmpty()) {
|
||||||
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
|
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
|
||||||
} else {
|
} else {
|
||||||
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
||||||
@ -105,7 +105,7 @@ public class DefaultHelpCommand extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
} else if (!parent.isOnlyPlayer()) {
|
} else if (!parent.isOnlyPlayer()) {
|
||||||
// Console. Only show if it is a console command
|
// Console. Only show if it is a console command
|
||||||
if (params.isEmpty()) {
|
if (params == null || params.isEmpty()) {
|
||||||
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
|
user.sendMessage(HELP_SYNTAX_NO_PARAMETERS_REF, USAGE_PLACEHOLDER, usage, DESC_PLACEHOLDER, desc);
|
||||||
} else {
|
} else {
|
||||||
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
user.sendMessage(HELP_SYNTAX_REF, USAGE_PLACEHOLDER, usage, PARAMS_PLACEHOLDER, params, DESC_PLACEHOLDER, desc);
|
||||||
|
@ -140,11 +140,9 @@ public class DefaultHelpCommandTest {
|
|||||||
Mockito.verify(user).getTranslationOrNothing("parameters");
|
Mockito.verify(user).getTranslationOrNothing("parameters");
|
||||||
Mockito.verify(user).getTranslation("description");
|
Mockito.verify(user).getTranslation("description");
|
||||||
Mockito.verify(user).sendMessage(
|
Mockito.verify(user).sendMessage(
|
||||||
"commands.help.syntax",
|
"commands.help.syntax-no-parameters",
|
||||||
"[usage]",
|
"[usage]",
|
||||||
"island",
|
"island",
|
||||||
"[parameters]",
|
|
||||||
"",
|
|
||||||
"[description]",
|
"[description]",
|
||||||
"the main island command"
|
"the main island command"
|
||||||
);
|
);
|
||||||
@ -169,11 +167,9 @@ public class DefaultHelpCommandTest {
|
|||||||
Mockito.verify(user).getTranslationOrNothing("parameters");
|
Mockito.verify(user).getTranslationOrNothing("parameters");
|
||||||
Mockito.verify(user).getTranslation("description");
|
Mockito.verify(user).getTranslation("description");
|
||||||
Mockito.verify(user).sendMessage(
|
Mockito.verify(user).sendMessage(
|
||||||
"commands.help.syntax",
|
"commands.help.syntax-no-parameters",
|
||||||
"[usage]",
|
"[usage]",
|
||||||
"island",
|
"island",
|
||||||
"[parameters]",
|
|
||||||
"",
|
|
||||||
"[description]",
|
"[description]",
|
||||||
"the main island command"
|
"the main island command"
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user