public interface World extends Extent
Modifier and Type | Method and Description |
---|---|
void |
checkLoadedChunk(Vector position)
Load the chunk at the given position if it isn't loaded.
|
boolean |
clearContainerBlockContents(Vector position)
Clear a chest's contents.
|
Mask |
createLiquidMask()
Create a mask that matches all liquids.
|
void |
dropItem(Vector position,
BaseItemStack item)
Drop one stack of the item at the given position.
|
void |
dropItem(Vector position,
BaseItemStack item,
int count)
Drop an item at the given position.
|
boolean |
equals(java.lang.Object other) |
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.
|
boolean |
generateBigTree(EditSession editSession,
Vector position)
Deprecated.
Use
#generateTree(TreeType, EditSession, Vector) |
boolean |
generateBirchTree(EditSession editSession,
Vector position)
Deprecated.
Use
#generateTree(TreeType, EditSession, Vector) |
boolean |
generateRedwoodTree(EditSession editSession,
Vector position)
Deprecated.
Use
#generateTree(TreeType, EditSession, Vector) |
boolean |
generateTallRedwoodTree(EditSession editSession,
Vector position)
Deprecated.
Use
#generateTree(TreeType, EditSession, Vector) |
boolean |
generateTree(EditSession editSession,
Vector position)
Deprecated.
Use
#generateTree(TreeType, EditSession, Vector) |
boolean |
generateTree(TreeGenerator.TreeType type,
EditSession editSession,
Vector position)
Generate a tree at the given position.
|
int |
getBlockData(Vector pt)
Deprecated.
|
int |
getBlockLightLevel(Vector position)
Get the light level at the given block.
|
int |
getBlockType(Vector pt)
Deprecated.
|
int |
getMaxY()
Get the maximum Y.
|
java.lang.String |
getName()
Get the name of the world.
|
WorldData |
getWorldData()
Get the data for blocks and so on for this world.
|
int |
hashCode() |
boolean |
isValidBlockType(int id)
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 |
regenerate(Region region,
EditSession editSession)
Regenerate an area.
|
boolean |
setBlock(Vector position,
BaseBlock block,
boolean notifyAndLight)
Similar to
OutputExtent.setBlock(Vector, BaseBlock) but a
notifyAndLight parameter indicates whether adjacent blocks
should be notified that changes have been made and lighting operations
should be executed. |
void |
setBlockData(Vector position,
int data)
Deprecated.
|
boolean |
setBlockType(Vector position,
int type)
Deprecated.
|
boolean |
setTypeIdAndData(Vector position,
int type,
int data)
Deprecated.
|
void |
simulateBlockMine(Vector position)
Simulate a block being mined at the given position.
|
boolean |
usesBlockData(int id)
Checks whether the given block ID uses data values for differentiating
types of blocks.
|
createEntity, getEntities, getEntities, getMaximumPoint, getMinimumPoint
getBiome, getBlock, getLazyBlock
commit, setBiome, setBlock
java.lang.String getName()
int getMaxY()
boolean isValidBlockType(int id)
id
- the block IDboolean usesBlockData(int id)
id
- the block IDMask createLiquidMask()
Implementations should override this so that custom liquids are supported.
@Deprecated int getBlockType(Vector pt)
InputExtent.getLazyBlock(Vector)
@Deprecated int getBlockData(Vector pt)
InputExtent.getLazyBlock(Vector)
boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException
OutputExtent.setBlock(Vector, BaseBlock)
but a
notifyAndLight
parameter indicates whether adjacent blocks
should be notified that changes have been made and lighting operations
should be executed.
If it's not possible to skip lighting, or if it's not possible to avoid notifying adjacent blocks, then attempt to meet the specification as best as possible.
On implementations where the world is not simulated, the
notifyAndLight
parameter has no effect either way.
position
- position of the blockblock
- block to setnotifyAndLight
- true to to notify and lightWorldEditException
@Deprecated boolean setBlockType(Vector position, int type)
OutputExtent.setBlock(Vector, BaseBlock)
@Deprecated void setBlockData(Vector position, int data)
OutputExtent.setBlock(Vector, BaseBlock)
@Deprecated boolean setTypeIdAndData(Vector position, int type, int data)
OutputExtent.setBlock(Vector, BaseBlock)
int getBlockLightLevel(Vector position)
position
- the positionboolean clearContainerBlockContents(Vector position)
position
- the positionvoid dropItem(Vector position, BaseItemStack item, int count)
position
- the positionitem
- the item to dropcount
- the number of individual stacks to drop (number of item entities)void dropItem(Vector position, BaseItemStack item)
position
- the positionitem
- the item to dropshortcut method to specify the number of stacks
void simulateBlockMine(Vector position)
position
- the positionboolean regenerate(Region region, EditSession editSession)
region
- the regioneditSession
- the EditSession
boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector position) throws MaxChangedBlocksException
type
- the tree typeeditSession
- the EditSession
position
- the positionMaxChangedBlocksException
- thrown if too many blocks were changed@Deprecated boolean generateTree(EditSession editSession, Vector position) throws MaxChangedBlocksException
#generateTree(TreeType, EditSession, Vector)
MaxChangedBlocksException
@Deprecated boolean generateBigTree(EditSession editSession, Vector position) throws MaxChangedBlocksException
#generateTree(TreeType, EditSession, Vector)
MaxChangedBlocksException
@Deprecated boolean generateBirchTree(EditSession editSession, Vector position) throws MaxChangedBlocksException
#generateTree(TreeType, EditSession, Vector)
MaxChangedBlocksException
@Deprecated boolean generateRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException
#generateTree(TreeType, EditSession, Vector)
MaxChangedBlocksException
@Deprecated boolean generateTallRedwoodTree(EditSession editSession, Vector position) throws MaxChangedBlocksException
#generateTree(TreeType, EditSession, Vector)
MaxChangedBlocksException
void checkLoadedChunk(Vector position)
position
- the positionvoid fixAfterFastMode(java.lang.Iterable<BlockVector2D> chunks)
Fast mode makes calls to 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.
chunks
- a list of chunk coordinates to fixvoid fixLighting(java.lang.Iterable<BlockVector2D> chunks)
chunks
- a list of chunk coordinates to fixboolean playEffect(Vector position, int type, int data)
position
- the positiontype
- the effect typedata
- the effect databoolean queueBlockBreakEffect(Platform server, Vector position, int blockId, double priority)
server
- the serverposition
- the positionblockId
- the block IDpriority
- the priorityWorldData getWorldData()
boolean equals(java.lang.Object other)
equals
in class java.lang.Object
int hashCode()
hashCode
in class java.lang.Object