Skip to content

Commit

Permalink
feat: Minecraft 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Dec 6, 2024
1 parent 8bea9f8 commit 217ca09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -60,7 +61,9 @@ public Collection<String> 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)
Expand Down

0 comments on commit 217ca09

Please sign in to comment.