public abstract class AbstractWorld extends Object implements World
World.| Constructor and Description |
|---|
AbstractWorld() |
| Modifier and Type | Method and Description |
|---|---|
void |
checkLoadedChunk(Vector pt)
Load the chunk at the given position if it isn't loaded.
|
Operation |
commit()
Return an
Operation that should be called to tie up loose ends
(such as to commit changes in a buffer). |
Mask |
createLiquidMask()
Create a mask that matches all liquids.
|
void |
dropItem(Vector pt,
BaseItemStack item,
int times)
Drop an item at the given position.
|
void |
fixAfterFastMode(Iterable<BlockVector2D> chunks)
Fix the given chunks after fast mode was used.
|
void |
fixLighting(Iterable<BlockVector2D> chunks)
Relight the given chunks if possible.
|
boolean |
generateBigTree(EditSession editSession,
Vector pt) |
boolean |
generateBirchTree(EditSession editSession,
Vector pt) |
boolean |
generateRedwoodTree(EditSession editSession,
Vector pt) |
boolean |
generateTallRedwoodTree(EditSession editSession,
Vector pt) |
boolean |
generateTree(EditSession editSession,
Vector pt) |
int |
getBlockData(Vector pt) |
int |
getBlockType(Vector pt) |
Vector |
getMaximumPoint()
Get the maximum point in the extent.
|
int |
getMaxY()
Get the maximum Y.
|
Vector |
getMinimumPoint()
Get the minimum point in the extent.
|
boolean |
isValidBlockType(int type)
Checks whether the given block ID is a valid block ID.
|
boolean |
playEffect(Vector position,
int type,
int data)
Play the given effect.
|
boolean |
queueBlockBreakEffect(Platform server,
Vector position,
int blockId,
double priority)
Queue a block break effect.
|
boolean |
setBlock(Vector pt,
BaseBlock block)
Change the block at the given location to the given block.
|
void |
setBlockData(Vector position,
int data) |
boolean |
setBlockType(Vector position,
int type) |
boolean |
setTypeIdAndData(Vector position,
int type,
int data) |
void |
simulateBlockMine(Vector pt)
Simulate a block being mined at the given position.
|
boolean |
usesBlockData(int type)
Checks whether the given block ID uses data values for differentiating
types of blocks.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearContainerBlockContents, dropItem, equals, generateTree, getBlockLightLevel, getName, getWorldData, hashCode, regenerate, setBlockcreateEntity, getEntities, getEntitiesgetBiome, getBlock, getLazyBlocksetBiomepublic final boolean setBlockType(Vector position, int type)
setBlockType in interface Worldpublic final void setBlockData(Vector position, int data)
setBlockData in interface Worldpublic final boolean setTypeIdAndData(Vector position, int type, int data)
setTypeIdAndData in interface Worldpublic final boolean setBlock(Vector pt, BaseBlock block) throws WorldEditException
OutputExtentBaseBlock to the world, so future changes to the
BaseBlock do not affect the world until this method is called again.
The return value of this method indicates whether the change was probably successful. It may not be successful if, for example, the location is out of the bounds of the extent. It may be unsuccessful if the block passed is the same as the one in the world. However, the return value is only an estimation and it may be incorrect, but it could be used to count, for example, the approximate number of changes.
setBlock in interface OutputExtentpt - position of the blockblock - block to setWorldEditException - thrown on an errorpublic int getMaxY()
Worldpublic boolean isValidBlockType(int type)
WorldisValidBlockType in interface Worldtype - the block IDpublic boolean usesBlockData(int type)
WorldusesBlockData in interface Worldtype - the block IDpublic Mask createLiquidMask()
WorldImplementations should override this so that custom liquids are supported.
createLiquidMask in interface Worldpublic int getBlockType(Vector pt)
getBlockType in interface Worldpublic int getBlockData(Vector pt)
getBlockData in interface Worldpublic void dropItem(Vector pt, BaseItemStack item, int times)
Worldpublic void simulateBlockMine(Vector pt)
WorldsimulateBlockMine in interface Worldpt - the positionpublic boolean generateTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTree in interface WorldMaxChangedBlocksExceptionpublic boolean generateBigTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateBigTree in interface WorldMaxChangedBlocksExceptionpublic boolean generateBirchTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateBirchTree in interface WorldMaxChangedBlocksExceptionpublic boolean generateRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateRedwoodTree in interface WorldMaxChangedBlocksExceptionpublic boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException
generateTallRedwoodTree in interface WorldMaxChangedBlocksExceptionpublic void checkLoadedChunk(Vector pt)
WorldcheckLoadedChunk in interface Worldpt - the positionpublic void fixAfterFastMode(Iterable<BlockVector2D> chunks)
WorldFast mode makes calls to World.setBlock(Vector, BaseBlock, boolean)
with false for the notifyAndLight parameter, which
may causes lighting errors to accumulate. Use of this method, if
it is implemented by the underlying world, corrects those lighting
errors and may trigger block change notifications.
fixAfterFastMode in interface Worldchunks - a list of chunk coordinates to fixpublic void fixLighting(Iterable<BlockVector2D> chunks)
WorldfixLighting in interface Worldchunks - a list of chunk coordinates to fixpublic boolean playEffect(Vector position, int type, int data)
WorldplayEffect in interface Worldposition - the positiontype - the effect typedata - the effect datapublic boolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority)
WorldqueueBlockBreakEffect in interface Worldserver - the serverposition - the positionblockId - the block IDpriority - the prioritypublic Vector getMinimumPoint()
ExtentIf the extent is unbounded, then a large (negative) value may be returned.
getMinimumPoint in interface Extentpublic Vector getMaximumPoint()
ExtentIf the extent is unbounded, then a large (positive) value may be returned.
getMaximumPoint in interface Extent@Nullable public Operation commit()
OutputExtentOperation that should be called to tie up loose ends
(such as to commit changes in a buffer).commit in interface OutputExtentCopyright © 2010-2014. All Rights Reserved.