public abstract class World extends Object implements NegativityObject
Modifier and Type | Field and Description |
---|---|
protected BlockHashMap |
content |
protected EmptyBlock |
emptyBlock |
Constructor and Description |
---|
World() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Block |
getBlockAt(double x,
double y,
double z)
Get the block at the specified location on this world
Return a block with AIR type if not found
Try to load from cache or get with getBlockAt0(int, int, int) |
Block |
getBlockAt(int x,
int y,
int z)
Get the block at the specified location on this world
Return a block with AIR type if not found
Try to load from cache or get with getBlockAt0(int, int, int) |
Block |
getBlockAt(Location loc)
Get the block at the specified location on this world
Return a block with AIR type if not found
Try to load from cache or get with getBlockAt0(int, int, int) |
Block |
getBlockAt(Vector v)
Get the block at the specified location on this world
Return a block with AIR type if not found
Try to load from cache or get with getBlockAt0(int, int, int) |
abstract Block |
getBlockAt0(int x,
int y,
int z)
Get the block at the specified location on this world
Return a block with AIR type if not found
Can create error if world not loaded AND loading it async Load directly from world |
Block |
getBlockAt0(Location loc)
Get the block at the specified location on this world
Return a block with AIR type if not found
Can create error if world not loaded AND loading it async Load directly from world |
abstract Difficulty |
getDifficulty()
Get the world difficulty
|
abstract List<Entity> |
getEntities() |
abstract Optional<Entity> |
getEntityById(int id) |
abstract int |
getMaxHeight()
Get the max height of the world
|
abstract int |
getMinHeight()
Get the min height of the world
|
abstract String |
getName()
Get the world name
|
static World |
getWorld(String name)
Get world instance
|
static World |
getWorld(String name,
Function<String,World> worldFunction)
Get world instance
|
static ConcurrentHashMap<String,World> |
getWorlds() |
abstract boolean |
isChunkLoaded(int chunkX,
int chunkZ) |
boolean |
isChunkLoaded(Location loc) |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefault
protected final BlockHashMap content
protected final EmptyBlock emptyBlock
public static ConcurrentHashMap<String,World> getWorlds()
public static World getWorld(String name)
name
- the name of worldpublic static World getWorld(String name, Function<String,World> worldFunction)
name
- the name of worldworldFunction
- create the world that will be storedpublic abstract String getName()
public Block getBlockAt(int x, int y, int z)
getBlockAt0(int, int, int)
x
- The X block locationy
- The Y block locationz
- The Z block locationpublic Block getBlockAt(double x, double y, double z)
getBlockAt0(int, int, int)
x
- The X block locationy
- The Y block locationz
- The Z block locationpublic Block getBlockAt(Vector v)
getBlockAt0(int, int, int)
v
- the block vector positionpublic Block getBlockAt(Location loc)
getBlockAt0(int, int, int)
loc
- the block locationpublic Block getBlockAt0(Location loc)
loc
- the block locationpublic abstract Block getBlockAt0(int x, int y, int z)
x
- The X block locationy
- The Y block locationz
- The Z block locationpublic abstract Difficulty getDifficulty()
public abstract int getMaxHeight()
public abstract int getMinHeight()
public boolean isChunkLoaded(Location loc)
public abstract boolean isChunkLoaded(int chunkX, int chunkZ)