mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-01-31 19:16:44 +01:00
You cannot use the unset race with /racelist
This commit is contained in:
parent
ece00ef88e
commit
8e76ac5db7
1 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,11 @@ class RacelistCommand {
|
|||
builder.then(CommandManager.literal("allow")
|
||||
.then(CommandManager.argument("race", raceArgument)
|
||||
.executes(context -> toggle(context.getSource(), context.getSource().getPlayer(), Race.fromArgument(context, "race"), "allowed", race -> {
|
||||
|
||||
if (race.isUnset()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean result = Unicopia.getConfig().speciesWhiteList.get().add(race.getId().toString());
|
||||
|
||||
Unicopia.getConfig().save();
|
||||
|
@ -48,7 +53,11 @@ class RacelistCommand {
|
|||
String translationKey = "commands.racelist." + action;
|
||||
|
||||
if (!func.apply(race)) {
|
||||
translationKey += ".failed";
|
||||
if (race.isUnset()) {
|
||||
translationKey = "commands.racelist.illegal";
|
||||
} else {
|
||||
translationKey += ".failed";
|
||||
}
|
||||
}
|
||||
|
||||
Text formattedName = race.getDisplayName().copy().formatted(Formatting.GOLD);
|
||||
|
|
Loading…
Reference in a new issue