Skip to content

Commit

Permalink
Fix INmsBiomeAccess.getBiomeGridAt
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauriichan committed Aug 31, 2021
1 parent d54021c commit 2270c78
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down

0 comments on commit 2270c78

Please sign in to comment.