Package com.sk89q.worldedit.extent
Interface Extent
- All Superinterfaces:
InputExtent
,OutputExtent
- All Known Subinterfaces:
Clipboard
,IChunkExtent<T>
,IQueueExtent<T>
,ReorderingExtent
,SimpleWorld
,World
- All Known Implementing Classes:
AbstractBufferingExtent
,AbstractDelegateExtent
,AbstractExtentFilterBlock
,AbstractFilterBlock
,AbstractSingleFilterBlock
,AbstractWorld
,ArrayFilterBlock
,BiomeQuirkExtent
,BlockArrayClipboard
,BlockBagExtent
,BlockChangeLimiter
,BlockQuirkExtent
,BlockTransformExtent
,BlockTranslateExtent
,ChangeSetExtent
,CharFilterBlock
,ChunkBatchingExtent
,ChunkFilterBlock
,ChunkLoadingExtent
,CPUOptimizedClipboard
,DataValidatorExtent
,DisallowedBlocksExtent
,DiskOptimizedClipboard
,EditSession
,EmptyClipboard
,ExtentBatchProcessorHolder
,ExtentBuffer
,ExtentFilterBlock
,ExtentHeightCacher
,FaweRegionExtent
,FilterBlock
,ForgetfulExtentBuffer
,FuzzyRegionSelector
,HeightBoundExtent
,HistoryExtent
,LastAccessExtentCache
,LimitExtent
,Linear3DTransform
,LinearClipboard
,LinearTransform
,MaskingExtent
,MemoryCheckingExtent
,MemoryOptimizedClipboard
,MultiRegionExtent
,MultiStageReorder
,MultiTransform
,NullExtent
,NullExtent
,NullWorld
,OffsetTransform
,ParallelQueueExtent
,PassthroughExtent
,PatternTransform
,PositionTransformExtent
,ProcessedWEExtent
,RandomOffsetTransform
,RandomTransform
,ReadOnlyClipboard
,RequestExtent
,ResettableExtent
,ScaleTransform
,SelectTransform
,SideEffectExtent
,SimpleClipboard
,SingleFilterBlock
,SingleRegionExtent
,SingleThreadQueueExtent
,SlowExtent
,SourceMaskExtent
,StripNBTExtent
,SupplyingExtent
,SurvivalModeExtent
,TemporalExtent
,TracingExtent
,TransformExtent
,VectorizedCharFilterBlock
,WatchdogTickingExtent
,WorldCopyClipboard
,WorldWrapper
A world, portion of a world, clipboard, or other object that can have blocks
set or entities placed.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
default void
addOre
(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) default void
default Extent
addPostProcessor
(IBatchProcessor processor) default Extent
addProcessor
(IBatchProcessor processor) Have an extent processed - Either block (Extent) processing or chunk processingdefault void
addSchems
(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) default <T extends Filter>
Tdefault <T extends Filter>
Tapply
(Iterable<BlockVector3> positions, T filter) default boolean
cancel()
default int
Sets the blocks at the center of the given region to the given pattern.default Operation
commit()
Return anOperation
that should be called to tie up loose ends (such as to commit changes in a buffer).default boolean
contains
(int x, int y, int z) Returns true if the extent contains the given positiondefault boolean
contains
(BlockVector3 pt) Returns true if the extent contains the given positiondefault int
countBlocks
(Region region, Mask searchMask) Count the number of blocks of a list of types in a region.default int
countBlocks
(Region region, Set<BaseBlock> searchBlocks) Count the number of blocks of a list of types in a region.default Entity
createEntity
(Location location, BaseEntity entity) Create an entity at the given location.default Entity
createEntity
(Location location, BaseEntity entity, UUID uuid) Create an entity at the given location, forcing a UUID onto the entity Only use if you are aware of the consequences of forcing a UUID to an entity.default Extent
default void
default Extent
enableHistory
(AbstractChangeSet changeSet) default void
default void
getBlockDistribution
(Region region) Get the block distribution inside a region.default List
<Countable<BlockState>> getBlockDistributionWithData
(Region region) Get the block distribution (with data values) inside a region.Get a list of all entities.getEntities
(Region region) Get a list of all entities within the given region.default int
getHighestTerrainBlock
(int x, int z, int minY, int maxY) Returns the highest solid 'terrain' (movement-blocking) block.default int
getHighestTerrainBlock
(int x, int z, int minY, int maxY, Mask filter) Returns the highest block matching the given mask.Get the maximum point in the extent.default int
getMaxY()
Get the minimum point in the extent.default int
getMinY()
default int
getNearestSurfaceLayer
(int x, int z, int y, int minY, int maxY) Returns the nearest surface layer (up/down from start), where a layer is 1/16th of a block to allow for snow, liquid, etc.default int
getNearestSurfaceTerrainBlock
(int x, int z, int y, int minY, int maxY) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc).default int
getNearestSurfaceTerrainBlock
(int x, int z, int y, int minY, int maxY, boolean ignoreAir) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc).default int
getNearestSurfaceTerrainBlock
(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc).default int
getNearestSurfaceTerrainBlock
(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, boolean ignoreAir) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc).default int
getNearestSurfaceTerrainBlock
(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, Mask mask) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc) where the block conforms to a given mask.default boolean
default boolean
isWorld()
default Clipboard
Lazily copy a regiondefault boolean
regenerateChunk
(int x, int z, BiomeType type, Long seed) default boolean
relight
(int x, int y, int z) default boolean
relightBlock
(int x, int y, int z) default boolean
relightSky
(int x, int y, int z) default void
removeEntity
(int x, int y, int z, UUID uuid) Create an entity at the given location.default int
replaceBlocks
(Region region, Mask mask, Pattern pattern) Replaces all the blocks matching a given mask, within a given region, to a block returned by a given pattern.default <B extends BlockStateHolder<B>>
intreplaceBlocks
(Region region, Set<BaseBlock> filter, B replacement) Replaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.default int
replaceBlocks
(Region region, Set<BaseBlock> filter, Pattern pattern) Replaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.default <B extends BlockStateHolder<B>>
intSets all the blocks inside a region to a given block type.default int
Sets all the blocks inside a region to a given pattern.default int
setBlocks
(Set<BlockVector3> vset, Pattern pattern) default void
spawnResource
(Region region, Resource gen, int rarity, int frequency) Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBiome, getBiomeType, getBlock, getBlock, getBrightness, getBrightness, getEmittedLight, getEmittedLight, getFullBlock, getFullBlock, getHeightMap, getOpacity, getOpacity, getSkyLight, getSkyLight
Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent
fullySupports3DBiomes, setBiome, setBiome, setBiome, setBlock, setBlock, setBlockLight, setBlockLight, setHeightMap, setSkyLight, setSkyLight, setTile, tile
-
Method Details
-
getMinimumPoint
BlockVector3 getMinimumPoint()Get the minimum point in the extent.If the extent is unbounded, then a large (negative) value may be returned.
- Returns:
- the minimum point
-
getMaximumPoint
BlockVector3 getMaximumPoint()Get the maximum point in the extent.If the extent is unbounded, then a large (positive) value may be returned.
- Returns:
- the maximum point
-
getEntities
Get a list of all entities within the given region.If 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.
- Parameters:
region
- the region in which entities must be contained- Returns:
- a list of entities
-
getEntities
Get a list of all entities.If 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.
- Returns:
- a list of entities
-
createEntity
Create an entity at the given location.- Parameters:
location
- the locationentity
- the entity- Returns:
- a reference to the created entity, or null if the entity could not be created
-
createEntity
Create an entity at the given location, forcing a UUID onto the entity Only use if you are aware of the consequences of forcing a UUID to an entity.- Parameters:
location
- the locationentity
- the entityuuid
- UUID to force the entity to have- Returns:
- a reference to the created entity, or null if the entity could not be created
- Since:
- 2.4.0
-
removeEntity
Create an entity at the given location.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateuuid
- the unique identifier of the entity
-
isQueueEnabled
default boolean isQueueEnabled() -
enableQueue
default void enableQueue() -
disableQueue
default void disableQueue() -
isWorld
default boolean isWorld() -
regenerateChunk
-
getHighestTerrainBlock
default int getHighestTerrainBlock(int x, int z, int minY, int maxY) Returns the highest solid 'terrain' (movement-blocking) block.- Parameters:
x
- the X coordinatez
- the Z coordinateminY
- minimal heightmaxY
- maximal height- Returns:
- height of highest block found or 'minY'
-
getHighestTerrainBlock
Returns the highest block matching the given mask.- Parameters:
x
- the X coordinatez
- the Z coordinateminY
- minimal heightmaxY
- maximal heightfilter
- a mask of blocks to consider, or null to consider any solid (movement-blocking) block- Returns:
- height of highest block found or 'minY'
-
getNearestSurfaceLayer
default int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) Returns the nearest surface layer (up/down from start), where a layer is 1/16th of a block to allow for snow, liquid, etc.- Parameters:
x
- x to search fromz
- y to search fromy
- z to search fromminY
- min y to search (inclusive)maxY
- max y to search (inclusive)- Returns:
- nearest surface layer
-
getNearestSurfaceTerrainBlock
default int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, Mask mask) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc) where the block conforms to a given mask. Searches in the x,z column given.- Parameters:
x
- column xz
- column zy
- start yminY
- minimum y height to consider. Inclusive.maxY
- maximum y height to consider. Inclusive.failedMin
- if nothing found, the minimum y value to return if returning minfailedMax
- if nothing found, the maximum y value to return if returning maxmask
- mask to test blocks against- Returns:
- The y value of the nearest terrain block
-
getNearestSurfaceTerrainBlock
default int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, boolean ignoreAir) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc). Searches in the x,z column given.- Parameters:
x
- column xz
- column zy
- start yminY
- minimum y height to consider. Inclusive.maxY
- maximum y height to consider. Inclusive.ignoreAir
- if air at the final value if no block found should be considered for return, else return -1- Returns:
- The y value of the nearest terrain block
-
getNearestSurfaceTerrainBlock
default int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc). Searches in the x,z column given.- Parameters:
x
- column xz
- column zy
- start yminY
- minimum y height to consider. Inclusive.maxY
- maximum y height to consider. Inclusive.- Returns:
- The y value of the nearest terrain block
-
getNearestSurfaceTerrainBlock
default int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc). Searches in the x,z column given.- Parameters:
x
- column xz
- column zy
- start yminY
- minimum y height to consider. Inclusive.maxY
- maximum y height to consider. Inclusive.failedMin
- if nothing found, the minimum y value to return if returning minfailedMax
- if nothing found, the maximum y value to return if returning max- Returns:
- The y value of the nearest terrain block
-
getNearestSurfaceTerrainBlock
default int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, boolean ignoreAir) Gets y value for the nearest block that is considered the surface of the terrain (cave roof/floor, mountain surface, etc). Searches in the x,z column given.- Parameters:
x
- column xz
- column zy
- start yminY
- minimum y height to consider. Inclusive.maxY
- maximum y height to consider. Inclusive.failedMin
- if nothing found, the minimum y value to return if returning minfailedMax
- if nothing found, the maximum y value to return if returning maxignoreAir
- if air at the final value if no block found should be considered for return, else return -1- Returns:
- The y value of the nearest terrain block
-
addCaves
- Throws:
WorldEditException
-
generate
- Throws:
WorldEditException
-
addSchems
default void addSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) throws WorldEditException - Throws:
WorldEditException
-
spawnResource
default void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException - Throws:
WorldEditException
-
contains
Returns true if the extent contains the given position- Parameters:
pt
- position- Returns:
- if position is contained
-
contains
default boolean contains(int x, int y, int z) Returns true if the extent contains the given position- Parameters:
x
- position xy
- position yz
- position z- Returns:
- if position is contained
-
addOre
default void addOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) throws WorldEditException - Throws:
WorldEditException
-
addOres
- Throws:
WorldEditException
-
getBlockDistribution
Get the block distribution inside a region.- Parameters:
region
- a region- Returns:
- the results
-
getBlockDistributionWithData
Get the block distribution (with data values) inside a region.- Parameters:
region
- a region- Returns:
- the results
-
commit
Description copied from interface:OutputExtent
Return anOperation
that should be called to tie up loose ends (such as to commit changes in a buffer).- Specified by:
commit
in interfaceOutputExtent
- Returns:
- an operation or null if there is none to execute
-
cancel
default boolean cancel() -
getMinY
default int getMinY() -
getMaxY
default int getMaxY() -
lazyCopy
Lazily copy a region- Parameters:
region
-- Returns:
-
countBlocks
Count the number of blocks of a list of types in a region.- Parameters:
region
- the regionsearchBlocks
- the list of blocks to search- Returns:
- the number of blocks that matched the block
-
countBlocks
Count the number of blocks of a list of types in a region.- Parameters:
region
- the regionsearchMask
- mask to match- Returns:
- the number of blocks that matched the mask
-
setBlocks
default <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException Sets all the blocks inside a region to a given block type.- Parameters:
region
- the regionblock
- the block- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
setBlocks
Sets all the blocks inside a region to a given pattern.- Parameters:
region
- the regionpattern
- the pattern that provides the replacement block- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
replaceBlocks
default <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws MaxChangedBlocksException Replaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.- Parameters:
region
- the region to replace the blocks withinfilter
- a list of block types to match, or null to useExistingBlockMask
replacement
- the replacement block- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
replaceBlocks
default int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) throws MaxChangedBlocksException Replaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.- Parameters:
region
- the region to replace the blocks withinfilter
- a list of block types to match, or null to useExistingBlockMask
pattern
- the pattern that provides the new blocks- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
replaceBlocks
default int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException Replaces all the blocks matching a given mask, within a given region, to a block returned by a given pattern.- Parameters:
region
- the region to replace the blocks withinmask
- the mask that blocks must matchpattern
- the pattern that provides the new blocks- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
center
Sets the blocks at the center of the given region to the given pattern. If the center sits between two blocks on a certain axis, then two blocks will be placed to mark the center.- Parameters:
region
- the region to find the center ofpattern
- the replacement pattern- Returns:
- the number of blocks placed
- Throws:
MaxChangedBlocksException
- thrown if too many blocks are changed
-
setBlocks
-
relight
default boolean relight(int x, int y, int z) -
relightBlock
default boolean relightBlock(int x, int y, int z) -
relightSky
default boolean relightSky(int x, int y, int z) -
addProcessor
Have an extent processed - Either block (Extent) processing or chunk processing- Parameters:
processor
-- Returns:
- processed Extent
-
addPostProcessor
-
enableHistory
-
disableHistory
-
apply
-
apply
-