@ThreadSafe public interface Chunk
Modifier and Type | Method and Description |
---|---|
Block |
blockAt(int relX,
int y,
int relZ)
Obtains a block relative to the chunk
|
Set<Entity> |
entities()
The entities in the chunk
|
void |
generate()
Generates the chunk
|
ArrayList<Entity> |
getEntities(Entity exclude,
BoundingBox boundingBox,
java.util.function.Predicate<? super Entity> predicate)
Find all entities that are colliding with the bounding box
|
boolean |
isLoaded()
Checks the chunk to ensure it is loaded
|
boolean |
load()
Loads the chunk
|
ChunkLocation |
location()
The location of the chunk
|
ChunkSnapshot |
snapshot()
Obtains a snapshot of the state of the chunk
|
Collection<Tile> |
tiles()
Obtains the tile entities in this chunk
|
void |
unload()
Unloads the chunk
|
World |
world()
The world which contains this chunk
|
int |
x()
Shortcut for:
location().x() |
int |
z()
Shortcut for:
location().z() |
void generate()
boolean load()
true
to signify that the chunk was successfully loaded from file, false
to signify that
it does not exist on file, or already loadedboolean isLoaded()
true
to signify that the chunk is loaded, false
if it is notvoid unload()
ArrayList<Entity> getEntities(Entity exclude, BoundingBox boundingBox, java.util.function.Predicate<? super Entity> predicate)
exclude
- the entity to exclude from the searchboundingBox
- The bounding box to search inpredicate
- Predicate to filter resultsCollection<Tile> tiles()
ChunkLocation location()
int x()
location().x()
int z()
location().z()
Block blockAt(int relX, int y, int relZ)
relX
- the relative x 0-15y
- the y coordinaterelZ
- the relative z 0-15ChunkSnapshot snapshot()
Copyright © 2016. All rights reserved.