Fix #4
All checks were successful
KnarCraft/PlayerPayouts/pipeline/head This commit looks good
All checks were successful
KnarCraft/PlayerPayouts/pipeline/head This commit looks good
This commit is contained in:
parent
f4a5811156
commit
7a817595c1
@ -11,6 +11,8 @@ import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* A command for overriding payments for specific groups
|
||||
*/
|
||||
@ -41,6 +43,11 @@ public class SetGroupPaymentCommand implements CommandExecutor {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Arrays.stream(PermissionManager.getPermissionGroups()).noneMatch(item -> item.equals(arguments[0]))) {
|
||||
stringFormatter.displayErrorMessage(commandSender, Translatable.GROUP_INVALID);
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
String group = arguments[0];
|
||||
if (StringHelper.isNonValue(arguments[1])) {
|
||||
|
@ -53,6 +53,11 @@ public enum Translatable implements TranslatableMessage {
|
||||
*/
|
||||
PAYOUT_RECEIVED,
|
||||
|
||||
/**
|
||||
* The message displayed when an invalid permission group has been provided
|
||||
*/
|
||||
GROUP_INVALID,
|
||||
|
||||
;
|
||||
|
||||
@Override
|
||||
|
@ -7,4 +7,5 @@ en:
|
||||
PLAYER_PAYOUT_SET: "Player payout for player {player} has been set to {value}"
|
||||
PAYOUT_NUMBER_REQUIRED: "Payout must be a number"
|
||||
PLAYER_ID_REQUIRED: "You must supply a valid name of an online player, or a UUID"
|
||||
PAYOUT_RECEIVED: "You got a paycheck of {value}"
|
||||
PAYOUT_RECEIVED: "You got a paycheck of {value}"
|
||||
GROUP_INVALID: "You have specified an invalid permission group"
|
Loading…
Reference in New Issue
Block a user