mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Fixed seapony race appearing in the selection screen
This commit is contained in:
parent
ca935ce224
commit
4a94c63e9b
2 changed files with 3 additions and 3 deletions
|
@ -98,7 +98,7 @@ public record Race (
|
|||
public static final Race HIPPOGRIFF = register("hippogriff", new Builder().foraging().flight(FlightType.AVIAN).cloudMagic()
|
||||
.abilities(Abilities.TOGGLE_FLIGHT, Abilities.SCREECH, Abilities.PECK, Abilities.DASH, Abilities.CARRY)
|
||||
);
|
||||
public static final Race SEAPONY = register("seapony", new Builder().foraging().fish()
|
||||
public static final Race SEAPONY = register("seapony", new Builder().availability(Availability.COMMANDS).foraging().fish()
|
||||
.abilities(Abilities.SONAR_PULSE)
|
||||
);
|
||||
|
||||
|
@ -229,7 +229,7 @@ public record Race (
|
|||
Identifier id = context.getArgument(name, RegistryKey.class).getValue();
|
||||
final Identifier idf = id;
|
||||
if (id.getNamespace() == Identifier.DEFAULT_NAMESPACE && !REGISTRY.containsId(id)) {
|
||||
id = Unicopia.id(id.getPath());
|
||||
id = new Identifier(REGISTRY_KEY.getValue().getNamespace(), id.getPath());
|
||||
}
|
||||
return REGISTRY.getOrEmpty(id).orElseThrow(() -> UNKNOWN_RACE_EXCEPTION.create(idf));
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import net.minecraft.util.Identifier;
|
|||
|
||||
public class UCommandSuggestion {
|
||||
public static final SuggestionProvider<ServerCommandSource> ALL_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY);
|
||||
public static final SuggestionProvider<ServerCommandSource> ALLOWED_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY, (context, race) -> race.isPermitted(context.getSource().getPlayer()));
|
||||
public static final SuggestionProvider<ServerCommandSource> ALLOWED_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY, (context, race) -> race.availability().isGrantable() && race.isPermitted(context.getSource().getPlayer()));
|
||||
|
||||
public static <T> SuggestionProvider<ServerCommandSource> suggestFromRegistry(RegistryKey<? extends Registry<T>> registryKey, @Nullable BiPredicate<CommandContext<ServerCommandSource>, T> filter) {
|
||||
return (context, builder) -> {
|
||||
|
|
Loading…
Reference in a new issue