public abstract class LocalWorld extends Object implements World
| Modifier and Type | Class and Description |
|---|---|
class |
LocalWorld.KillFlags
Named flags to use as parameters to
killMobs(Vector, double, int) |
| Modifier and Type | Field and Description |
|---|---|
protected Random |
random
Random generator.
|
| Constructor and Description |
|---|
LocalWorld() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkLoadedChunk(Vector pt)
Checks if the chunk pt is in is loaded.
|
abstract boolean |
clearContainerBlockContents(Vector pt)
Clear a chest's contents.
|
abstract boolean |
copyFromWorld(Vector pt,
BaseBlock block)
Attempts to read a BaseBlock's extra data from the world.
|
abstract boolean |
copyToWorld(Vector pt,
BaseBlock block)
Attempts to accurately copy a BaseBlock's extra data to the world.
|
abstract void |
dropItem(Vector pt,
BaseItemStack item)
Drop an item.
|
void |
dropItem(Vector pt,
BaseItemStack item,
int times)
Drop an item.
|
abstract boolean |
equals(Object other)
Compare if the other world is equal.
|
void |
fixAfterFastMode(Iterable<BlockVector2D> chunks)
Does some post-processing.
|
void |
fixLighting(Iterable<BlockVector2D> chunks) |
boolean |
generateBigTree(EditSession editSession,
Vector pt)
Deprecated.
|
boolean |
generateBirchTree(EditSession editSession,
Vector pt)
Deprecated.
|
boolean |
generateRedwoodTree(EditSession editSession,
Vector pt)
Deprecated.
|
boolean |
generateTallRedwoodTree(EditSession editSession,
Vector pt)
Deprecated.
|
boolean |
generateTree(EditSession editSession,
Vector pt)
Deprecated.
|
boolean |
generateTree(TreeGenerator.TreeType type,
EditSession editSession,
Vector pt)
Generates a tree
|
abstract BiomeType |
getBiome(Vector2D pt)
Get biome type
|
BaseBlock |
getBlock(Vector pt)
Get a copy of the block at the given location.
|
abstract int |
getBlockData(Vector pt)
Get block data.
|
abstract int |
getBlockLightLevel(Vector pt)
Get block light level.
|
abstract int |
getBlockType(Vector pt)
Get block type.
|
LocalEntity[] |
getEntities(Region region) |
int |
getMaxY()
Get the world's height
|
abstract String |
getName()
Get the name of the world.
|
abstract int |
hashCode()
Hash code.
|
boolean |
isValidBlockType(int type)
Returns whether a block has a valid ID.
|
int |
killEntities(LocalEntity... entities) |
int |
killMobs(Vector origin,
double radius,
int flags)
Kill mobs in an area.
|
int |
killMobs(Vector origin,
int radius)
Deprecated.
|
int |
killMobs(Vector origin,
int radius,
boolean killPets)
Deprecated.
|
boolean |
playEffect(Vector position,
int type,
int data)
Plays the minecraft effect with the given type and data at the given position.
|
boolean |
queueBlockBreakEffect(ServerInterface server,
Vector position,
int blockId,
double priority) |
abstract boolean |
regenerate(Region region,
EditSession editSession)
Regenerate an area.
|
abstract int |
removeEntities(EntityType type,
Vector origin,
int radius)
Remove entities in an area.
|
abstract void |
setBiome(Vector2D pt,
BiomeType biome)
Set the biome type
|
boolean |
setBlock(Vector pt,
Block block,
boolean notifyAdjacent)
Change the block at the given location to the given block.
|
abstract void |
setBlockData(Vector pt,
int data)
Deprecated.
|
abstract void |
setBlockDataFast(Vector pt,
int data)
Deprecated.
|
abstract boolean |
setBlockType(Vector pt,
int type)
Deprecated.
|
boolean |
setBlockTypeFast(Vector pt,
int type)
Deprecated.
|
boolean |
setTypeIdAndData(Vector pt,
int type,
int data)
Deprecated.
|
boolean |
setTypeIdAndDataFast(Vector pt,
int type,
int data)
Deprecated.
|
void |
simulateBlockMine(Vector pt)
Simulate a block being mined.
|
boolean |
usesBlockData(int type)
Returns whether a block uses its data value.
|
protected Random random
public abstract String getName()
@Deprecated public abstract boolean setBlockType(Vector pt, int type)
pt - type - @Deprecated public boolean setBlockTypeFast(Vector pt, int type)
pt - type - public abstract int getBlockType(Vector pt)
pt - @Deprecated public abstract void setBlockData(Vector pt, int data)
pt - data - @Deprecated public abstract void setBlockDataFast(Vector pt, int data)
pt - data - public abstract BiomeType getBiome(Vector2D pt)
pt - The (x, z) location to check the biome atpublic abstract void setBiome(Vector2D pt, BiomeType biome)
pt - The (x, z) location to set the biome atbiome - The biome type to set to@Deprecated public boolean setTypeIdAndData(Vector pt, int type, int data)
pt - type - data - @Deprecated public boolean setTypeIdAndDataFast(Vector pt, int type, int data)
pt - type - data - public abstract int getBlockData(Vector pt)
pt - public abstract int getBlockLightLevel(Vector pt)
pt - public abstract boolean regenerate(Region region, EditSession editSession)
region - editSession - public abstract boolean copyToWorld(Vector pt, BaseBlock block)
pt - block - public abstract boolean copyFromWorld(Vector pt, BaseBlock block)
pt - block - public abstract boolean clearContainerBlockContents(Vector pt)
pt - @Deprecated public boolean generateTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree(com.sk89q.worldedit.util.TreeGenerator.TreeType, EditSession, Vector) insteadeditSession - pt - MaxChangedBlocksException@Deprecated public boolean generateBigTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree(com.sk89q.worldedit.util.TreeGenerator.TreeType, EditSession, Vector) insteadeditSession - pt - MaxChangedBlocksException@Deprecated public boolean generateBirchTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree(com.sk89q.worldedit.util.TreeGenerator.TreeType, EditSession, Vector) insteadeditSession - pt - MaxChangedBlocksException@Deprecated public boolean generateRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree(com.sk89q.worldedit.util.TreeGenerator.TreeType, EditSession, Vector) insteadeditSession - pt - MaxChangedBlocksException@Deprecated public boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree(com.sk89q.worldedit.util.TreeGenerator.TreeType, EditSession, Vector) insteadeditSession - pt - MaxChangedBlocksExceptionpublic boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt) throws MaxChangedBlocksException
type - The type of tree to generateeditSession - The EditSession to pass block changes throughpt - The point where the base of the tree should be locatedMaxChangedBlocksException - if too many blocks were changed by the EditSessionpublic void dropItem(Vector pt, BaseItemStack item, int times)
pt - item - times - public abstract void dropItem(Vector pt, BaseItemStack item)
pt - item - public void simulateBlockMine(Vector pt)
pt - @Deprecated public int killMobs(Vector origin, int radius)
origin - The center of the area to kill mobs inradius - -1 for the whole world@Deprecated public int killMobs(Vector origin, int radius, boolean killPets)
origin - The center of the area to kill mobs inradius - -1 for all mobskillPets - whether to kill petspublic int killMobs(Vector origin, double radius, int flags)
origin - The center of the area to kill mobs inradius - -1 for all mobsflags - various flags that determine what to killpublic abstract int removeEntities(EntityType type, Vector origin, int radius)
type - origin - radius - public boolean isValidBlockType(int type)
type - public boolean usesBlockData(int type)
type - block ID typepublic void checkLoadedChunk(Vector pt)
pt - Position to checkpublic abstract boolean equals(Object other)
public int getMaxY()
public void fixAfterFastMode(Iterable<BlockVector2D> chunks)
chunks - the chunks to fixpublic void fixLighting(Iterable<BlockVector2D> chunks)
public boolean playEffect(Vector position, int type, int data)
position - type - data - public boolean queueBlockBreakEffect(ServerInterface server, Vector position, int blockId, double priority)
public LocalEntity[] getEntities(Region region)
public int killEntities(LocalEntity... entities)
public boolean setBlock(Vector pt, Block block, boolean notifyAdjacent)
WorldBlock to the world, so future changes to the
Block do not affect the world until this method is called again.
Implementations may or may not consider the value of the notifyAdjacent
parameter, and implementations may to choose to either apply physics anyway or
to not apply any physics (particularly in a stand-alone implementation).
The return value of this method indicates whether the change "went through," as
in the block was changed in the world in any way. If the new block is no different
than the block already at the position in the world, 'false' would be returned.
If the position is invalid (out of bounds, for example), then nothing should
occur and 'false' should be returned. If possible, the return value should be
accurate as possible, but implementations may choose to not provide an accurate
value if it is not possible to know.public BaseBlock getBlock(Vector pt)
WorldBlock have no effect until
World.setBlock(Vector, Block, boolean) is called.Copyright © 2010-2014. All Rights Reserved.