public abstract class AbstractWorld extends java.lang.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(java.lang.Iterable<BlockVector2D> chunks)
Fix the given chunks after fast mode was used.
|
void |
fixLighting(java.lang.Iterable<BlockVector2D> chunks)
Relight the given chunks if possible.
|
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 |
playEffect(Vector position,
int type,
int data)
Play the given effect.
|
boolean |
queueBlockBreakEffect(Platform server,
Vector position,
BlockType blockType,
double priority)
Queue a block break effect.
|
boolean |
setBlock(Vector pt,
BlockStateHolder block)
Change the block at the given location to the given block.
|
boolean |
useItem(Vector position,
BaseItem item,
Direction face)
Use the given item on the block at the given location on the given side.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearContainerBlockContents, dropItem, equals, generateTree, getBlockLightLevel, getName, getRemainingWeatherDuration, getWeather, hashCode, regenerate, setBlock, setWeather, setWeather, simulateBlockMine
createEntity, getEntities, getEntities
getBiome, getBlock, getFullBlock
setBiome
public boolean useItem(Vector position, BaseItem item, Direction face)
World
public final boolean setBlock(Vector pt, BlockStateHolder block) throws WorldEditException
OutputExtent
BlockStateHolder
to the world, so future changes to the
BlockStateHolder
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 OutputExtent
pt
- position of the blockblock
- block to setWorldEditException
- thrown on an errorpublic int getMaxY()
World
public Mask createLiquidMask()
World
Implementations should override this so that custom liquids are supported.
createLiquidMask
in interface World
public void dropItem(Vector pt, BaseItemStack item, int times)
World
public void checkLoadedChunk(Vector pt)
World
checkLoadedChunk
in interface World
pt
- the positionpublic void fixAfterFastMode(java.lang.Iterable<BlockVector2D> chunks)
World
Fast mode makes calls to World.setBlock(Vector, BlockStateHolder, 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 World
chunks
- a list of chunk coordinates to fixpublic void fixLighting(java.lang.Iterable<BlockVector2D> chunks)
World
fixLighting
in interface World
chunks
- a list of chunk coordinates to fixpublic boolean playEffect(Vector position, int type, int data)
World
playEffect
in interface World
position
- the positiontype
- the effect typedata
- the effect datapublic boolean queueBlockBreakEffect(Platform server, Vector position, BlockType blockType, double priority)
World
queueBlockBreakEffect
in interface World
server
- the serverposition
- the positionblockType
- the block typepriority
- the prioritypublic Vector getMinimumPoint()
Extent
If the extent is unbounded, then a large (negative) value may be returned.
getMinimumPoint
in interface Extent
public Vector getMaximumPoint()
Extent
If the extent is unbounded, then a large (positive) value may be returned.
getMaximumPoint
in interface Extent
@Nullable public Operation commit()
OutputExtent
Operation
that should be called to tie up loose ends
(such as to commit changes in a buffer).commit
in interface OutputExtent