From 4a94c63e9bcaa3dcee69b84a3fa3ae52cb89e2ff Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 9 Apr 2024 12:34:30 +0100 Subject: [PATCH] Fixed seapony race appearing in the selection screen --- src/main/java/com/minelittlepony/unicopia/Race.java | 4 ++-- .../minelittlepony/unicopia/command/UCommandSuggestion.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/Race.java b/src/main/java/com/minelittlepony/unicopia/Race.java index 93131646..9c02ecdb 100644 --- a/src/main/java/com/minelittlepony/unicopia/Race.java +++ b/src/main/java/com/minelittlepony/unicopia/Race.java @@ -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)); } diff --git a/src/main/java/com/minelittlepony/unicopia/command/UCommandSuggestion.java b/src/main/java/com/minelittlepony/unicopia/command/UCommandSuggestion.java index d6e46350..e8ab6b1c 100644 --- a/src/main/java/com/minelittlepony/unicopia/command/UCommandSuggestion.java +++ b/src/main/java/com/minelittlepony/unicopia/command/UCommandSuggestion.java @@ -21,7 +21,7 @@ import net.minecraft.util.Identifier; public class UCommandSuggestion { public static final SuggestionProvider ALL_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY); - public static final SuggestionProvider ALLOWED_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY, (context, race) -> race.isPermitted(context.getSource().getPlayer())); + public static final SuggestionProvider ALLOWED_RACE_SUGGESTIONS = suggestFromRegistry(Race.REGISTRY_KEY, (context, race) -> race.availability().isGrantable() && race.isPermitted(context.getSource().getPlayer())); public static SuggestionProvider suggestFromRegistry(RegistryKey> registryKey, @Nullable BiPredicate, T> filter) { return (context, builder) -> {