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)
ChunkSnapshot
apply
in interface ChunkSnapshot
chunk
- the chunk to reset the data contained in this snapshot topublic void apply()
ChunkSnapshot
apply
in interface ChunkSnapshot
public Set<Entity> entities()
Chunk
public Collection<Tile> tiles()
Chunk
public boolean isLoaded()
Chunk
public ChunkLocation location()
Chunk
public World world()
Chunk
public Block blockAt(int relX, int y, int relZ)
Chunk
public ChunkSnapshot snapshot()
Chunk
public ArrayList<Entity> getEntities(Entity exclude, BoundingBox boundingBox, java.util.function.Predicate<? super Entity> predicate)
Chunk
getEntities
in interface Chunk
exclude
- the entity to exclude from the searchboundingBox
- The bounding box to search inpredicate
- Predicate to filter resultsCopyright © 2016. All rights reserved.