Class PassthroughExtent
- All Implemented Interfaces:
Extent,InputExtent,OutputExtent
- Direct Known Subclasses:
EditSession,ExtentHeightCacher,FuzzyRegionSelector,MemoryCheckingExtent,ParallelQueueExtent,SupplyingExtent,TemporalExtent
-
Field Summary
Fields inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
extent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) voidvoidaddSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) <T extends Filter>
T<T extends Filter>
Tapply(Iterable<BlockVector3> positions, T filter) booleancancel()intSets the blocks at the center of the given region to the given pattern.booleancontains(BlockVector3 pt) Returns true if the extent contains the given positionintcountBlocks(Region region, Mask searchMask) Count the number of blocks of a list of types in a region.intcountBlocks(Region region, Set<BaseBlock> searchBlocks) Count the number of blocks of a list of types in a region.createEntity(Location location, BaseEntity entity) Create an entity at the given location.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.voidvoidvoidgetBiome(BlockVector3 position) Get the biome at the given location.getBiomeType(int x, int y, int z) getBlock(int x, int y, int z) getBlock(BlockVector3 position) Get a snapshot of the block at the given location.getBlockDistribution(Region region) Get the block distribution inside a region.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.getFullBlock(int x, int y, int z) getFullBlock(BlockVector3 position) Get an immutable snapshot of the block at the given location.intgetHighestTerrainBlock(int x, int z, int minY, int maxY) Returns the highest solid 'terrain' (movement-blocking) block.intgetHighestTerrainBlock(int x, int z, int minY, int maxY, Mask filter) Returns the highest block matching the given mask.intgetNearestSurfaceLayer(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.intgetNearestSurfaceTerrainBlock(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).intgetNearestSurfaceTerrainBlock(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).intgetNearestSurfaceTerrainBlock(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).intgetNearestSurfaceTerrainBlock(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).intgetNearestSurfaceTerrainBlock(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.booleanbooleanisWorld()Lazily copy a regionbooleanregenerateChunk(int x, int z, BiomeType type, Long seed) voidremoveEntity(int x, int y, int z, UUID uuid) Create an entity at the given location.intreplaceBlocks(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.<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.intreplaceBlocks(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.booleanbooleansetBiome(BlockVector3 position, BiomeType biome) Set the biome.<T extends BlockStateHolder<T>>
booleansetBlock(int x, int y, int z, T block) <T extends BlockStateHolder<T>>
booleansetBlock(BlockVector3 position, T block) Deprecated.<B extends BlockStateHolder<B>>
intSets all the blocks inside a region to a given block type.intSets all the blocks inside a region to a given pattern.intsetBlocks(Set<BlockVector3> vset, Pattern pattern) booleansetTile(int x, int y, int z, CompoundTag tile) voidspawnResource(Region region, Resource gen, int rarity, int frequency) Methods inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
addPostProcessor, addProcessor, commit, commitBefore, disableHistory, fullySupports3DBiomes, getBrightness, getEmittedLight, getExtent, getMaximumPoint, getMaxY, getMinimumPoint, getMinY, getSkyLight, relight, relightBlock, relightSky, setBlockLight, setChangeSet, setSkyLight, tile, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sk89q.worldedit.extent.Extent
contains, enableHistoryMethods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBrightness, getEmittedLight, getHeightMap, getOpacity, getOpacity, getSkyLightMethods inherited from interface com.sk89q.worldedit.extent.OutputExtent
setBiome, setBlockLight, setHeightMap, setSkyLight
-
Constructor Details
-
PassthroughExtent
Create a new instance.- Parameters:
extent- the extent
-
-
Method Details
-
regenerateChunk
-
getHighestTerrainBlock
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) Description copied from interface:ExtentReturns 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
Description copied from interface:ExtentReturns 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
public int getNearestSurfaceLayer(int x, int z, int y, int minY, int maxY) Description copied from interface:ExtentReturns 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
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, boolean ignoreAir) Description copied from interface:ExtentGets 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
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY) Description copied from interface:ExtentGets 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
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax) Description copied from interface:ExtentGets 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
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, Mask mask) Description copied from interface:ExtentGets 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
public int getNearestSurfaceTerrainBlock(int x, int z, int y, int minY, int maxY, int failedMin, int failedMax, boolean ignoreAir) Description copied from interface:ExtentGets 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
public void addSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) throws WorldEditException - Throws:
WorldEditException
-
spawnResource
public void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException - Throws:
WorldEditException
-
contains
Description copied from interface:ExtentReturns true if the extent contains the given position- Parameters:
pt- position- Returns:
- if position is contained
-
addOre
public 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
Description copied from interface:ExtentGet the block distribution inside a region.- Specified by:
getBlockDistributionin interfaceExtent- Overrides:
getBlockDistributionin classAbstractDelegateExtent- Parameters:
region- a region- Returns:
- the results
-
getBlockDistributionWithData
Description copied from interface:ExtentGet the block distribution (with data values) inside a region.- Specified by:
getBlockDistributionWithDatain interfaceExtent- Overrides:
getBlockDistributionWithDatain classAbstractDelegateExtent- Parameters:
region- a region- Returns:
- the results
-
lazyCopy
Description copied from interface:ExtentLazily copy a region- Parameters:
region-- Returns:
-
countBlocks
Description copied from interface:ExtentCount the number of blocks of a list of types in a region.- Specified by:
countBlocksin interfaceExtent- Overrides:
countBlocksin classAbstractDelegateExtent- Parameters:
region- the regionsearchBlocks- the list of blocks to search- Returns:
- the number of blocks that matched the block
-
countBlocks
Description copied from interface:ExtentCount the number of blocks of a list of types in a region.- Specified by:
countBlocksin interfaceExtent- Overrides:
countBlocksin classAbstractDelegateExtent- Parameters:
region- the regionsearchMask- mask to match- Returns:
- the number of blocks that matched the mask
-
setBlocks
public <B extends BlockStateHolder<B>> int setBlocks(Region region, B block) throws MaxChangedBlocksException Description copied from interface:ExtentSets all the blocks inside a region to a given block type.- Specified by:
setBlocksin interfaceExtent- Overrides:
setBlocksin classAbstractDelegateExtent- Parameters:
region- the regionblock- the block- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException- thrown if too many blocks are changed
-
setBlocks
Description copied from interface:ExtentSets all the blocks inside a region to a given pattern.- Specified by:
setBlocksin interfaceExtent- Overrides:
setBlocksin classAbstractDelegateExtent- 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
public <B extends BlockStateHolder<B>> int replaceBlocks(Region region, Set<BaseBlock> filter, B replacement) throws MaxChangedBlocksException Description copied from interface:ExtentReplaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.- Specified by:
replaceBlocksin interfaceExtent- Overrides:
replaceBlocksin classAbstractDelegateExtent- Parameters:
region- the region to replace the blocks withinfilter- a list of block types to match, or null to useExistingBlockMaskreplacement- the replacement block- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException- thrown if too many blocks are changed
-
replaceBlocks
public int replaceBlocks(Region region, Set<BaseBlock> filter, Pattern pattern) throws MaxChangedBlocksException Description copied from interface:ExtentReplaces all the blocks matching a given filter, within a given region, to a block returned by a given pattern.- Specified by:
replaceBlocksin interfaceExtent- Overrides:
replaceBlocksin classAbstractDelegateExtent- Parameters:
region- the region to replace the blocks withinfilter- a list of block types to match, or null to useExistingBlockMaskpattern- the pattern that provides the new blocks- Returns:
- number of blocks affected
- Throws:
MaxChangedBlocksException- thrown if too many blocks are changed
-
replaceBlocks
public int replaceBlocks(Region region, Mask mask, Pattern pattern) throws MaxChangedBlocksException Description copied from interface:ExtentReplaces all the blocks matching a given mask, within a given region, to a block returned by a given pattern.- Specified by:
replaceBlocksin interfaceExtent- Overrides:
replaceBlocksin classAbstractDelegateExtent- 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
Description copied from interface:ExtentSets 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
- Specified by:
setBlocksin interfaceExtent- Overrides:
setBlocksin classAbstractDelegateExtent
-
getBlock
Description copied from interface:InputExtentGet a snapshot of the block at the given location.If the given position is out of the bounds of the extent, then the behavior is undefined (an air block could be returned). However,
nullshould not be returned.The returned block is immutable 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.- Specified by:
getBlockin interfaceInputExtent- Overrides:
getBlockin classAbstractDelegateExtent- Parameters:
position- position of the block- Returns:
- the block
-
getBlock
- Specified by:
getBlockin interfaceInputExtent- Overrides:
getBlockin classAbstractDelegateExtent
-
getFullBlock
Description copied from interface:InputExtentGet an immutable snapshot of the block at the given location.- Specified by:
getFullBlockin interfaceInputExtent- Overrides:
getFullBlockin classAbstractDelegateExtent- Parameters:
position- position of the block- Returns:
- the block
-
getFullBlock
- Specified by:
getFullBlockin interfaceInputExtent- Overrides:
getFullBlockin classAbstractDelegateExtent
-
getEntities
Description copied from interface:ExtentGet 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.
- Specified by:
getEntitiesin interfaceExtent- Overrides:
getEntitiesin classAbstractDelegateExtent- Parameters:
region- the region in which entities must be contained- Returns:
- a list of entities
-
getEntities
Description copied from interface:ExtentGet 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.
- Specified by:
getEntitiesin interfaceExtent- Overrides:
getEntitiesin classAbstractDelegateExtent- Returns:
- a list of entities
-
createEntity
Description copied from interface:ExtentCreate an entity at the given location.- Specified by:
createEntityin interfaceExtent- Overrides:
createEntityin classAbstractDelegateExtent- Parameters:
location- the locationentity- the entity- Returns:
- a reference to the created entity, or null if the entity could not be created
-
createEntity
Description copied from interface:ExtentCreate 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.- Specified by:
createEntityin interfaceExtent- Overrides:
createEntityin classAbstractDelegateExtent- 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
-
setBlock
@Deprecated public <T extends BlockStateHolder<T>> boolean setBlock(BlockVector3 position, T block) throws WorldEditException Deprecated.Description copied from interface:OutputExtentChange the block at the given location to the given block. The operation may not tie the givenBlockStateHolderto the world, so future changes to theBlockStateHolderdo 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:
setBlockin interfaceOutputExtent- Overrides:
setBlockin classAbstractDelegateExtent- Parameters:
position- 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
-
setBlock
public <T extends BlockStateHolder<T>> boolean setBlock(int x, int y, int z, T block) throws WorldEditException - Specified by:
setBlockin interfaceOutputExtent- Overrides:
setBlockin classAbstractDelegateExtent- Throws:
WorldEditException
-
setTile
- Throws:
WorldEditException
-
setBiome
Description copied from interface:OutputExtentSet the biome.As implementation varies per Minecraft version, this may set more than this position's biome. On versions prior to 1.15, this will set the entire column. On later versions it will set the 4x4x4 cube.
- Specified by:
setBiomein interfaceOutputExtent- Overrides:
setBiomein classAbstractDelegateExtent- Parameters:
position- the (x, y, z) location to set the biome atbiome- the biome to set to- Returns:
- true if the biome was successfully set (return value may not be accurate)
-
setBiome
- Specified by:
setBiomein interfaceOutputExtent- Overrides:
setBiomein classAbstractDelegateExtent
-
cancel
public boolean cancel()- Specified by:
cancelin interfaceExtent- Overrides:
cancelin classAbstractDelegateExtent
-
removeEntity
Description copied from interface:ExtentCreate an entity at the given location.- Specified by:
removeEntityin interfaceExtent- Overrides:
removeEntityin classAbstractDelegateExtent- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinateuuid- the unique identifier of the entity
-
isQueueEnabled
public boolean isQueueEnabled()- Specified by:
isQueueEnabledin interfaceExtent- Overrides:
isQueueEnabledin classAbstractDelegateExtent
-
enableQueue
public void enableQueue()- Specified by:
enableQueuein interfaceExtent- Overrides:
enableQueuein classAbstractDelegateExtent
-
disableQueue
public void disableQueue()- Specified by:
disableQueuein interfaceExtent- Overrides:
disableQueuein classAbstractDelegateExtent
-
isWorld
public boolean isWorld()- Specified by:
isWorldin interfaceExtent- Overrides:
isWorldin classAbstractDelegateExtent
-
apply
- Specified by:
applyin interfaceExtent- Overrides:
applyin classAbstractDelegateExtent
-
getBiome
Description copied from interface:InputExtentGet the biome at the given location.If there is no biome available, then the ocean biome should be returned.
As implementation varies per Minecraft version, this may not exactly get this positions biome. On versions prior to 1.15, this will get the entire column. On later versions it will get the 4x4x4 cube's biome.
- Specified by:
getBiomein interfaceInputExtent- Overrides:
getBiomein classAbstractDelegateExtent- Parameters:
position- the (x, y, z) location to check the biome at- Returns:
- the biome at the location
- See Also:
-
getBiomeType
- Specified by:
getBiomeTypein interfaceInputExtent- Overrides:
getBiomeTypein classAbstractDelegateExtent
-
apply
-