mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-15 15:16:46 +01:00
Return constant empty set if the chunk is not loaded
This commit is contained in:
parent
90211ddf50
commit
250907df6c
@ -488,7 +488,7 @@ public abstract class Instance implements BlockModifier, Tickable, EventHandler,
|
||||
*/
|
||||
public @NotNull Set<Entity> getChunkEntities(Chunk chunk) {
|
||||
if (!ChunkUtils.isLoaded(chunk))
|
||||
return new HashSet<>();
|
||||
return Collections.emptySet();
|
||||
|
||||
final long index = ChunkUtils.getChunkIndex(chunk.getChunkX(), chunk.getChunkZ());
|
||||
final Set<Entity> entities = getEntitiesInChunk(index);
|
||||
|
Loading…
Reference in New Issue
Block a user