Skip to content

Commit

Permalink
Fixed cached biome of island can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Jan 25, 2022
1 parent 74925cf commit e51b461
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -1461,6 +1461,11 @@ public void setPaypal(String paypal) {

@Override
public Biome getBiome() {
if(biome == null) {
// Loads the chunk and gets the biome on the first block.
// This may be called if a placeholder is called before the island is loaded, for example.
biome = getCenter(plugin.getSettings().getWorlds().getDefaultWorld()).getBlock().getBiome();
}
return biome;
}

Expand All @@ -1469,6 +1474,7 @@ public void setBiome(Biome biome) {
setBiome(biome, true);
}

@Override
public void setBiome(Biome biome, boolean updateBlocks) {
Preconditions.checkNotNull(biome, "biome parameter cannot be null.");

Expand Down

0 comments on commit e51b461

Please sign in to comment.