From 2270c78f6541b616b719ea64463ce9a0c642cd10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Endre=C3=9F?= Date: Tue, 31 Aug 2021 21:27:15 +0200 Subject: [PATCH] Fix INmsBiomeAccess.getBiomeGridAt --- .../spigot/rwg/legacy/api/version/nms/INmsBiomeAccess.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/legacy-api/src/main/java/net/sourcewriters/spigot/rwg/legacy/api/version/nms/INmsBiomeAccess.java b/legacy-api/src/main/java/net/sourcewriters/spigot/rwg/legacy/api/version/nms/INmsBiomeAccess.java index 8acf37f..fa9abd0 100644 --- a/legacy-api/src/main/java/net/sourcewriters/spigot/rwg/legacy/api/version/nms/INmsBiomeAccess.java +++ b/legacy-api/src/main/java/net/sourcewriters/spigot/rwg/legacy/api/version/nms/INmsBiomeAccess.java @@ -5,7 +5,7 @@ import org.bukkit.block.Biome; import net.sourcewriters.spigot.rwg.legacy.api.generator.IRwgGenerator; -import net.sourcewriters.spigot.rwg.legacy.api.util.Checks; +import net.sourcewriters.spigot.rwg.legacy.api.generator.forward.ForwardHelper; import net.sourcewriters.spigot.rwg.legacy.api.util.annotation.source.NonNull; import net.sourcewriters.spigot.rwg.legacy.api.util.rwg.SearchBiomeGrid; @@ -16,10 +16,11 @@ default SearchBiomeGrid getBiomeGrid(Chunk chunk) { } default SearchBiomeGrid getBiomeGridAt(World world, int x, int z) { - if (Checks.isRwg(world)) { + IRwgGenerator generator = ForwardHelper.get(world); + if (generator == null) { return null; } - return ((IRwgGenerator) world.getGenerator()).getBiomeGridAt(this, world, x, z); + return generator.getBiomeGridAt(this, world, x, z); } @NonNull