Merge pull request #470 from MrBretze/master

Added isChunkLoaded to Instance.java
This commit is contained in:
TheMode 2021-09-20 19:56:14 +02:00 committed by GitHub
commit 62769fc343
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,6 +220,25 @@ public abstract class Instance implements BlockGetter, BlockSetter, Tickable, Ta
*/
public abstract @Nullable Chunk getChunk(int chunkX, int chunkZ);
/**
*
* @param chunkX the chunk X
* @param chunkZ this chunk Z
* @return true if the chunk is loaded
*/
public boolean isChunkLoaded(int chunkX, int chunkZ) {
return getChunk(chunkX, chunkZ) != null;
}
/**
*
* @param point coordinate of a block or other
* @return true if the chunk is loaded
*/
public boolean isChunkLoaded(Point point) {
return isChunkLoaded(point.chunkX(), point.chunkZ());
}
/**
* Saves the current instance tags.
* <p>