public class TridentChunkSnapshot extends Object implements ChunkSnapshot
| Constructor and Description |
|---|
TridentChunkSnapshot(TridentWorld world,
TridentChunk chunk) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply()
Updates the chunk from this snapshot with the data contained in this snapshot
|
void |
apply(Chunk chunk)
Loads the data of the snapshot into the specified chunk
|
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() |
public TridentChunkSnapshot(TridentWorld world, TridentChunk chunk)
public void apply(Chunk chunk)
ChunkSnapshotapply in interface ChunkSnapshotchunk - the chunk to reset the data contained in this snapshot topublic void apply()
ChunkSnapshotapply in interface ChunkSnapshotpublic Set<Entity> entities()
Chunkpublic Collection<Tile> tiles()
Chunkpublic boolean isLoaded()
Chunkpublic ChunkLocation location()
Chunkpublic World world()
Chunkpublic Block blockAt(int relX, int y, int relZ)
Chunkpublic ChunkSnapshot snapshot()
Chunkpublic ArrayList<Entity> getEntities(Entity exclude, BoundingBox boundingBox, java.util.function.Predicate<? super Entity> predicate)
ChunkgetEntities in interface Chunkexclude - the entity to exclude from the searchboundingBox - The bounding box to search inpredicate - Predicate to filter resultsCopyright © 2016. All rights reserved.