diff --git a/build.gradle.kts b/build.gradle.kts index 310a011..727a070 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { group = "com.github.siroshun09.biomefinder" version = "1.10" -val mcVersion = "1.21.3" +val mcVersion = "1.21.4" val fullVersion = "${version}-mc${mcVersion}" java { diff --git a/src/main/java/com/github/siroshun09/biomefinder/command/GenerateSeedCommand.java b/src/main/java/com/github/siroshun09/biomefinder/command/GenerateSeedCommand.java index 2481c2d..cf5f507 100644 --- a/src/main/java/com/github/siroshun09/biomefinder/command/GenerateSeedCommand.java +++ b/src/main/java/com/github/siroshun09/biomefinder/command/GenerateSeedCommand.java @@ -2,9 +2,10 @@ import com.github.siroshun09.biomefinder.util.SeedGenerator; import io.papermc.paper.command.brigadier.CommandSourceStack; +import io.papermc.paper.registry.RegistryAccess; +import io.papermc.paper.registry.RegistryKey; import net.kyori.adventure.key.Key; import org.bukkit.NamespacedKey; -import org.bukkit.Registry; import org.bukkit.block.Biome; import org.bukkit.command.CommandSender; import org.jspecify.annotations.NullMarked; @@ -43,7 +44,7 @@ protected void run(CommandSender sender, String[] args) { key = Key.key("minecraft:plains"); } - if (Registry.BIOME.get(new NamespacedKey(key.namespace(), key.value())) == null) { + if (RegistryAccess.registryAccess().getRegistry(RegistryKey.BIOME).get(new NamespacedKey(key.namespace(), key.value())) == null) { sender.sendMessage(INVALID_BIOME.apply(key.asString())); return; } @@ -60,7 +61,9 @@ public Collection suggest(CommandSourceStack source, String[] args) { return Collections.emptyList(); } - return Registry.BIOME.stream() + return RegistryAccess.registryAccess() + .getRegistry(RegistryKey.BIOME) + .stream() .map(Biome::getKey) .filter(key -> key.asString().startsWith(args[0]) || key.asMinimalString().startsWith(args[0])) .map(Key::asString)