Interface SimpleWorld
- All Superinterfaces:
Extent
,IChunkCache<IChunkGet>
,InputExtent
,Keyed
,OutputExtent
,Trimable
,World
World
.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Load the chunk at the given position if it isn't loaded.default Mask
Create a mask that matches all liquids.default void
dropItem
(Vector3 pt, BaseItemStack item, int times) Drop an item at the given position.default void
fixAfterFastMode
(Iterable<BlockVector2> chunks) Fix the given chunks after fast mode was used.default void
fixLighting
(Iterable<BlockVector2> chunks) Relight the given chunks if possible.default boolean
generateTree
(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 position) Generate a tree at the given position.default BaseBlock
getFullBlock
(BlockVector3 position) Get an immutable snapshot of the block at the given location.default BlockVector3
Get the maximum point in the extent.default int
getMaxY()
Get the maximum Y.default BlockVector3
Get the minimum point in the extent.default int
getMinY()
Get the minimum Y.default long
Gets the remaining weather duration.default Path
Get the folder in which this world is stored.default WeatherType
Gets the weather type of the world.default boolean
playEffect
(BlockVector3 position, int type, int data) default boolean
queueBlockBreakEffect
(Platform server, BlockVector3 position, BlockType blockType, double priority) Queue a block break effect.<B extends BlockStateHolder<B>>
booleansetBlock
(BlockVector3 pt, B block) Change the block at the given location to the given block.default <B extends BlockStateHolder<B>>
booleansetBlock
(BlockVector3 position, B block, boolean notifyAndLight) Similar toOutputExtent.setBlock(BlockVector3, BlockStateHolder)
but anotifyAndLight
parameter indicates whether adjacent blocks should be notified that changes have been made and lighting operations should be executed.default void
setWeather
(WeatherType weatherType) Sets the weather type of the world.default void
setWeather
(WeatherType weatherType, long duration) Sets the weather type of the world.default void
simulateBlockMine
(BlockVector3 position) Simulate a block being mined at the given position.default boolean
useItem
(BlockVector3 position, BaseItem item, Direction face) Use the given item on the block at the given location on the given side.Methods inherited from interface com.sk89q.worldedit.extent.Extent
addCaves, addOre, addOres, addPostProcessor, addProcessor, addSchems, apply, apply, cancel, center, commit, contains, contains, countBlocks, countBlocks, createEntity, createEntity, disableHistory, disableQueue, enableHistory, enableQueue, generate, getBlockDistribution, getBlockDistributionWithData, getEntities, getEntities, getHighestTerrainBlock, getHighestTerrainBlock, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, isQueueEnabled, lazyCopy, regenerateChunk, relight, relightBlock, relightSky, removeEntity, replaceBlocks, replaceBlocks, replaceBlocks, setBlocks, setBlocks, setBlocks, spawnResource
Methods inherited from interface com.fastasyncworldedit.core.queue.IChunkCache
trim
Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBiomeType, getBlock, getBlock, getBrightness, getBrightness, getEmittedLight, getEmittedLight, getFullBlock, getHeightMap, getOpacity, getOpacity, getSkyLight, getSkyLight
Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent
fullySupports3DBiomes, setBiome, setBlock, setBlockLight, setBlockLight, setHeightMap, setSkyLight, setSkyLight, setTile
Methods inherited from interface com.sk89q.worldedit.world.World
applySideEffects, canPlaceAt, clearContainerBlockContents, dropItem, equals, flush, get, getBiome, getBlockDrops, getBlockLightLevel, getId, getName, getNameUnsafe, getSpawnPosition, hashCode, isWorld, notifyAndLightBlock, playBlockBreakEffect, playEffect, refreshChunk, regenerate, regenerate, regenerate, sendFakeChunk, setBiome, setBiome, setBlock
-
Method Details
-
useItem
Description copied from interface:World
Use the given item on the block at the given location on the given side. -
setBlock
default <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, B block, boolean notifyAndLight) throws WorldEditException Description copied from interface:World
Similar toOutputExtent.setBlock(BlockVector3, BlockStateHolder)
but anotifyAndLight
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.- Specified by:
setBlock
in interfaceWorld
- Parameters:
position
- position of the blockblock
- block to setnotifyAndLight
- true to to notify and light- Returns:
- true if the block was successfully set (return value may not be accurate)
- Throws:
WorldEditException
-
getFullBlock
Description copied from interface:InputExtent
Get an immutable snapshot of the block at the given location.- Specified by:
getFullBlock
in interfaceInputExtent
- Parameters:
position
- position of the block- Returns:
- the block
-
setBlock
<B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 pt, B block) throws WorldEditException Description copied from interface:OutputExtent
Change the block at the given location to the given block. The operation may not tie the givenBlockStateHolder
to the world, so future changes to theBlockStateHolder
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.
- Specified by:
setBlock
in interfaceOutputExtent
- Parameters:
pt
- position of the blockblock
- block to set- Returns:
- true if the block was successfully set (return value may not be accurate)
- Throws:
WorldEditException
- thrown on an error
-
getStoragePath
Description copied from interface:World
Get the folder in which this world is stored. May return null if unknown or if this world is not serialized to disk.- Specified by:
getStoragePath
in interfaceWorld
- Returns:
- world storage path
-
getMaxY
default int getMaxY()Description copied from interface:World
Get the maximum Y. -
getMinY
default int getMinY()Description copied from interface:World
Get the minimum Y. -
createLiquidMask
Description copied from interface:World
Create a mask that matches all liquids.Implementations should override this so that custom liquids are supported.
- Specified by:
createLiquidMask
in interfaceWorld
- Returns:
- a mask
-
dropItem
Description copied from interface:World
Drop an item at the given position. -
checkLoadedChunk
Description copied from interface:World
Load the chunk at the given position if it isn't loaded.- Specified by:
checkLoadedChunk
in interfaceWorld
- Parameters:
pt
- the position
-
fixAfterFastMode
Description copied from interface:World
Fix the given chunks after fast mode was used.Fast mode makes calls to
World.setBlock(BlockVector3, BlockStateHolder, boolean)
withfalse
for thenotifyAndLight
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.- Specified by:
fixAfterFastMode
in interfaceWorld
- Parameters:
chunks
- a list of chunk coordinates to fix
-
fixLighting
Description copied from interface:World
Relight the given chunks if possible.- Specified by:
fixLighting
in interfaceWorld
- Parameters:
chunks
- a list of chunk coordinates to fix
-
playEffect
-
queueBlockBreakEffect
default boolean queueBlockBreakEffect(Platform server, BlockVector3 position, BlockType blockType, double priority) Description copied from interface:World
Queue a block break effect.- Specified by:
queueBlockBreakEffect
in interfaceWorld
- Parameters:
server
- the serverposition
- the positionblockType
- the block typepriority
- the priority- Returns:
- true if the effect was played
-
getMinimumPoint
Description copied from interface:Extent
Get the minimum point in the extent.If the extent is unbounded, then a large (negative) value may be returned.
- Specified by:
getMinimumPoint
in interfaceExtent
- Returns:
- the minimum point
-
getMaximumPoint
Description copied from interface:Extent
Get the maximum point in the extent.If the extent is unbounded, then a large (positive) value may be returned.
- Specified by:
getMaximumPoint
in interfaceExtent
- Returns:
- the maximum point
-
generateTree
default boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 position) throws MaxChangedBlocksException Description copied from interface:World
Generate a tree at the given position.- Specified by:
generateTree
in interfaceWorld
- Parameters:
type
- the tree typeeditSession
- theEditSession
position
- the position- Returns:
- true if generation was successful
- Throws:
MaxChangedBlocksException
- thrown if too many blocks were changed
-
simulateBlockMine
Description copied from interface:World
Simulate a block being mined at the given position.- Specified by:
simulateBlockMine
in interfaceWorld
- Parameters:
position
- the position
-
getWeather
Description copied from interface:World
Gets the weather type of the world.- Specified by:
getWeather
in interfaceWorld
- Returns:
- The weather
-
getRemainingWeatherDuration
default long getRemainingWeatherDuration()Description copied from interface:World
Gets the remaining weather duration.- Specified by:
getRemainingWeatherDuration
in interfaceWorld
- Returns:
- The weather duration
-
setWeather
Description copied from interface:World
Sets the weather type of the world.- Specified by:
setWeather
in interfaceWorld
- Parameters:
weatherType
- The weather type
-
setWeather
Description copied from interface:World
Sets the weather type of the world.- Specified by:
setWeather
in interfaceWorld
- Parameters:
weatherType
- The weather typeduration
- The duration of the weather
-