mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-16 05:02:19 +01:00
Merge pull request #470 from MrBretze/master
Added isChunkLoaded to Instance.java
This commit is contained in:
commit
62769fc343
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user