@ThreadSafe public class TridentWorld extends Object implements World
Modifier and Type | Method and Description |
---|---|
protected void |
addChunkAt(ChunkLocation location,
Chunk chunk) |
Entity |
addEntity(Entity entity) |
Block |
blockAt(Position location)
Gets the block on the given position
|
WorldBorder |
border()
Obtains the world border properties of this world
|
TridentChunk |
chunkAt(ChunkLocation location,
boolean generateIfNotFound)
Gets the chunk on the given position, and generates the chunk if it does not exist.
|
Chunk |
chunkAt(int x,
int z,
boolean generateIfNotFound)
Gets the chunk on the given x and z , and generates the chunk if it does not exist
|
ChunkHandler |
chunkHandler() |
Collection<Chunk> |
chunks()
Obtains the loaded chunks in the world
|
Set<Entity> |
entities()
Get the entities currently in this world
|
boolean |
equals(Object obj) |
TridentChunk |
generateChunk(ChunkLocation location)
Generates the chunk on the given position
|
Chunk |
generateChunk(int x,
int z)
Generates the chunk on the given position
|
ArrayList<Entity> |
getEntities(Entity exclude,
BoundingBox boundingBox,
java.util.function.Predicate<? super Entity> predicate)
Find all entities that are colliding with the bounding box
|
Set<Entity> |
internalEntities() |
void |
lightning(Position position,
boolean b)
Strikes lightning at the given location.
|
Collection<TridentChunk> |
loadedChunks() |
WorldLoader |
loader()
Obtains the loading handler which created this object, passed in from the constructor
|
String |
name()
Gets the name of the world
|
SoundEffect |
playSound(SoundEffectType sound)
Creates a new sound effect
|
GeneratorRandom |
random() |
void |
removeEntity(Entity entity) |
void |
save() |
void |
setTime(long l)
Sets the time of the world
|
WorldSettings |
settings()
Obtains the settings which modify the behavior of the world
|
Entity |
spawn(EntityType type,
Position spawnPosition)
Spawns an entity in the world
|
ParticleEffect |
spawnParticle(ParticleEffectType particle)
Creates a new particle effect
|
Position |
spawnPosition()
Gets the spawn position of the world
|
VisualEffect |
spawnVisual(VisualEffectType visual)
Creates a new visual effect
|
void |
tick() |
Set<Tile> |
tilesInternal() |
long |
time()
Gets the time in the world
|
String |
toString() |
WeatherConditions |
weather()
Obtains the weather controller for the world
|
public void tick()
protected void addChunkAt(ChunkLocation location, Chunk chunk)
public GeneratorRandom random()
public void save()
public void removeEntity(Entity entity)
public Collection<Chunk> chunks()
World
public Collection<TridentChunk> loadedChunks()
public ChunkHandler chunkHandler()
public Chunk chunkAt(int x, int z, boolean generateIfNotFound)
World
public TridentChunk chunkAt(ChunkLocation location, boolean generateIfNotFound)
World
public Chunk generateChunk(int x, int z)
World
generateChunk
in interface World
public TridentChunk generateChunk(ChunkLocation location)
World
generateChunk
in interface World
public Block blockAt(Position location)
World
public WorldLoader loader()
World
public Position spawnPosition()
World
spawnPosition
in interface World
public WeatherConditions weather()
World
public WorldSettings settings()
World
public WorldBorder border()
World
public Entity spawn(EntityType type, Position spawnPosition)
World
public Set<Entity> entities()
World
public Set<Entity> internalEntities()
public Set<Tile> tilesInternal()
public ParticleEffect spawnParticle(ParticleEffectType particle)
World
spawnParticle
in interface World
particle
- The particle to spawnpublic VisualEffect spawnVisual(VisualEffectType visual)
World
spawnVisual
in interface World
visual
- The visual to spawnpublic SoundEffect playSound(SoundEffectType sound)
World
public void lightning(Position position, boolean b)
World
public void setTime(long l)
World
public ArrayList<Entity> getEntities(Entity exclude, BoundingBox boundingBox, java.util.function.Predicate<? super Entity> predicate)
World
getEntities
in interface World
exclude
- the entity to exclude from searchingboundingBox
- The bounding box to search inpredicate
- Predicate to filter resultsCopyright © 2016. All rights reserved.