public class BukkitWorld extends LocalWorld
| Constructor and Description |
|---|
BukkitWorld(org.bukkit.World world)
Construct the object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkLoadedChunk(Vector pt)
Load the chunk at the given position if it isn't loaded.
|
boolean |
clearContainerBlockContents(Vector pt)
Clear a chest's contents.
|
Entity |
createEntity(Location location,
BaseEntity entity)
Create an entity at the given location.
|
void |
dropItem(Vector pt,
BaseItemStack item)
Drop one stack of the item at the given position.
|
boolean |
equals(Object other) |
void |
fixAfterFastMode(Iterable<BlockVector2D> chunks)
Fix the given chunks after fast mode was used.
|
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)
Generate a tree at the given position.
|
BaseBiome |
getBiome(Vector2D position)
Get the biome at the given location.
|
BaseBlock |
getBlock(Vector position)
Get a snapshot of the block at the given location.
|
int |
getBlockLightLevel(Vector pt)
Get the light level at the given block.
|
List<Entity> |
getEntities()
Get a list of all entities.
|
List<Entity> |
getEntities(Region region)
Get a list of all entities within the given region.
|
BaseBlock |
getLazyBlock(Vector position)
Get a lazy, immutable snapshot of the block at the given location that only
immediately contains information about the block's type (and metadata).
|
int |
getMaxY()
Get the maximum Y.
|
String |
getName()
Get the name of the world.
|
org.bukkit.World |
getWorld()
Get the world handle.
|
protected org.bukkit.World |
getWorldChecked()
Get the world handle.
|
WorldData |
getWorldData()
Get the data for blocks and so on for this world.
|
int |
hashCode() |
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 |
regenerate(Region region,
EditSession editSession)
Regenerate an area.
|
boolean |
setBiome(Vector2D position,
BaseBiome biome)
Set the biome.
|
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. |
boolean |
setBlock(Vector pt,
Block block,
boolean notifyAdjacent)
Deprecated.
|
void |
simulateBlockMine(Vector pt)
Simulate a block being mined at the given position.
|
static org.bukkit.TreeType |
toBukkitTreeType(TreeGenerator.TreeType type) |
commit, createLiquidMask, dropItem, fixLighting, getBlockData, getBlockType, getMaximumPoint, getMinimumPoint, queueBlockBreakEffect, setBlock, setBlockData, setBlockType, setTypeIdAndData, usesBlockDatapublic BukkitWorld(org.bukkit.World world)
world - the worldpublic List<Entity> getEntities(Region region)
ExtentIf the extent is not wholly loaded (i.e. a world being simulated in the game will not have every chunk loaded), then this list may not be incomplete.
region - the region in which entities must be containedpublic List<Entity> getEntities()
ExtentIf the extent is not wholly loaded (i.e. a world being simulated in the game will not have every chunk loaded), then this list may not be incomplete.
@Nullable public Entity createEntity(Location location, BaseEntity entity)
Extentlocation - the locationentity - the entitypublic org.bukkit.World getWorld()
protected org.bukkit.World getWorldChecked()
throws WorldEditException
WorldEditExceptionpublic String getName()
Worldpublic int getBlockLightLevel(Vector pt)
Worldpt - the positionpublic boolean regenerate(Region region, EditSession editSession)
Worldregion - the regioneditSession - the EditSessionpublic boolean clearContainerBlockContents(Vector pt)
Worldpt - the position@Deprecated public boolean generateTree(EditSession editSession, Vector pt)
generateTree in interface WorldgenerateTree in class LocalWorld@Deprecated public boolean generateBigTree(EditSession editSession, Vector pt)
generateBigTree in interface WorldgenerateBigTree in class LocalWorld@Deprecated public boolean generateBirchTree(EditSession editSession, Vector pt)
generateBirchTree in interface WorldgenerateBirchTree in class LocalWorld@Deprecated public boolean generateRedwoodTree(EditSession editSession, Vector pt)
generateRedwoodTree in interface WorldgenerateRedwoodTree in class LocalWorld@Deprecated public boolean generateTallRedwoodTree(EditSession editSession, Vector pt)
generateTallRedwoodTree in interface WorldgenerateTallRedwoodTree in class LocalWorldpublic static org.bukkit.TreeType toBukkitTreeType(TreeGenerator.TreeType type)
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, Vector pt)
WorldgenerateTree in interface WorldgenerateTree in class LocalWorldtype - the tree typeeditSession - the EditSessionpt - the positionpublic void dropItem(Vector pt, BaseItemStack item)
Worldpt - the positionitem - the item to dropshortcut method to specify the number of stackspublic boolean isValidBlockType(int type)
WorldisValidBlockType in interface WorldisValidBlockType in class AbstractWorldtype - the block IDpublic void checkLoadedChunk(Vector pt)
WorldcheckLoadedChunk in interface WorldcheckLoadedChunk in class AbstractWorldpt - the positionpublic boolean equals(Object other)
public int hashCode()
public int getMaxY()
WorldgetMaxY in interface WorldgetMaxY in class AbstractWorldpublic 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 WorldfixAfterFastMode in class AbstractWorldchunks - a list of chunk coordinates to fixpublic boolean playEffect(Vector position, int type, int data)
WorldplayEffect in interface WorldplayEffect in class AbstractWorldposition - the positiontype - the effect typedata - the effect datapublic WorldData getWorldData()
Worldpublic void simulateBlockMine(Vector pt)
WorldsimulateBlockMine in interface WorldsimulateBlockMine in class AbstractWorldpt - the positionpublic BaseBlock getBlock(Vector position)
InputExtentIf the given position is out of the bounds of the extent, then the behavior
is undefined (an air block could be returned). However, null
should not be returned.
The returned block is mutable and is a snapshot of the block at the time
of call. It has no position attached to it, so it could be reused in
Patterns and so on.
Calls to this method can actually be quite expensive, so cache results
whenever it is possible, while being aware of the mutability aspect.
The cost, however, depends on the implementation and particular extent.
If only basic information about the block is required, then use of
InputExtent.getLazyBlock(Vector) is recommended.
position - position of the blockpublic boolean setBlock(Vector position, BaseBlock block, boolean notifyAndLight) throws WorldEditException
WorldOutputExtent.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 lightWorldEditExceptionpublic BaseBlock getLazyBlock(Vector position)
InputExtentFurther information (such as NBT data) will be available by the time of access. Therefore, it is not recommended that this method is used if the world is being simulated at the time of call. If the block needs to be stored for future use, then this method should definitely not be used. Moreover, the block that is returned is immutable (or should be), and therefore modifications should not be attempted on it. If a modifiable copy is required, then the block should be cloned.
This method exists because it is sometimes important to inspect the block
at a given location, but InputExtent.getBlock(Vector) may be too expensive in
the underlying implementation. It is also not possible to implement
caching if the returned object is mutable, so this methods allows caching
implementations to be used.
getLazyBlock in interface InputExtentgetLazyBlock in class LocalWorldposition - position of the blockpublic BaseBiome getBiome(Vector2D position)
InputExtentIf there is no biome available, then the ocean biome should be returned.
position - the (x, z) location to check the biome atpublic boolean setBiome(Vector2D position, BaseBiome biome)
OutputExtentposition - the (x, z) location to set the biome atbiome - the biome to set to@Deprecated public boolean setBlock(Vector pt, Block block, boolean notifyAdjacent) throws WorldEditException
setBlock(Vector, BaseBlock, boolean)WorldEditExceptionCopyright © 2010-2014. All Rights Reserved.