Skip to content

Commit

Permalink
Fixed Island#getLoadedChunks returning null chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
OmerBenGera committed Jul 9, 2022
1 parent 1b6988f commit 66b8052
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Expand Up @@ -898,6 +898,7 @@ public List<Chunk> getLoadedChunks(boolean onlyProtected, boolean noEmptyChunks)
public List<Chunk> getLoadedChunks(World.Environment environment, boolean onlyProtected, boolean noEmptyChunks) {
World world = getCenter(environment).getWorld();
return new SequentialListBuilder<Chunk>()
.filter(Objects::nonNull)
.build(IslandUtils.getChunkCoords(this, world, onlyProtected, noEmptyChunks), plugin.getNMSChunks()::getChunkIfLoaded);
}

Expand Down
Expand Up @@ -8,6 +8,7 @@
import org.bukkit.block.Biome;
import org.bukkit.entity.Player;

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
Expand All @@ -26,6 +27,7 @@ public interface NMSChunks {

void refreshLights(Chunk chunk, List<SchematicBlock> blockData);

@Nullable
Chunk getChunkIfLoaded(ChunkPosition chunkPosition);

void startTickingChunk(Island island, Chunk chunk, boolean stop);
Expand Down

0 comments on commit 66b8052

Please sign in to comment.