Class NullExtent
- All Implemented Interfaces:
IBatchProcessor,Extent,InputExtent,OutputExtent,Serializable
- See Also:
-
Field Summary
Fields inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
extent -
Constructor Summary
ConstructorsConstructorDescriptionNullExtent(Extent extent, FaweException exception) NullExtent(Extent extent, com.sk89q.worldedit.util.formatting.text.Component failReason) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) voidaddPostProcessor(IBatchProcessor processor) addProcessor(IBatchProcessor processor) Have an extent processed - Either block (Extent) processing or chunk processingvoidaddSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) booleancancel()intSets the blocks at the center of the given region to the given pattern.commit()Return anOperationthat should be called to tie up loose ends (such as to commit changes in a buffer).Convert this processor into an Extent based processor instead of a queue batch based on.booleancontains(int x, int z) booleancontains(int x, int y, int z) 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 arg0, BaseEntity arg1) Create an entity at the given location.createEntity(Location arg0, BaseEntity arg1, UUID arg2) 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.Get the maximum point in the extent.intgetMaxY()Get the minimum point in the extent.intgetMinY()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, 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.getScope()Default to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.booleanbooleanisWorld()Lazily copy a regionvoidpostProcess(IChunk chunk, IChunkGet get, IChunkSet set) Post-process a chunk that has been edited.Future<?> postProcessSet(IChunk chunk, IChunkGet get, IChunkSet set) Post-process a chunk that has been edited.booleanprocessGet(int chunkX, int chunkZ) processSet(IChunk chunk, IChunkGet get, IChunkSet set) Process a chunk that has been set.booleanregenerateChunk(int x, int z, BiomeType type, Long seed) 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) <B extends BlockStateHolder<B>>
booleansetBlock(BlockVector3 position, B block) Change the block at the given location to the given block.<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.fastasyncworldedit.core.extent.FaweRegionExtent
contains, contains, isGlobalMethods inherited from class com.fastasyncworldedit.core.extent.ResettableExtent
init, setOriginMethods inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
apply, commitBefore, disableHistory, fullySupports3DBiomes, getBrightness, getEmittedLight, getExtent, getSkyLight, relight, relightBlock, relightSky, removeEntity, 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
apply, enableHistory, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlockMethods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, processGet, remove, trimNBT, trimNBT, trimYMethods 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
-
NullExtent
Create a new instance.- Parameters:
extent- the extent
-
NullExtent
-
NullExtent
public NullExtent()
-
-
Method Details
-
getMinimumPoint
Description copied from interface:ExtentGet the minimum point in the extent.If the extent is unbounded, then a large (negative) value may be returned.
- Specified by:
getMinimumPointin interfaceExtent- Overrides:
getMinimumPointin classAbstractDelegateExtent- Returns:
- the minimum point
-
getMaximumPoint
Description copied from interface:ExtentGet the maximum point in the extent.If the extent is unbounded, then a large (positive) value may be returned.
- Specified by:
getMaximumPointin interfaceExtent- Overrides:
getMaximumPointin classAbstractDelegateExtent- Returns:
- the maximum point
-
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 classFaweRegionExtent- Parameters:
arg0- the locationarg1- 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 classFaweRegionExtent- Parameters:
arg0- the locationarg1- the entityarg2- UUID to force the entity to have- Returns:
- a reference to the created entity, or null if the entity could not be created
-
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 classFaweRegionExtent- Parameters:
position- position of the block- Returns:
- the block
-
getBlock
- Specified by:
getBlockin interfaceInputExtent- Overrides:
getBlockin classFaweRegionExtent
-
getFullBlock
Description copied from interface:InputExtentGet an immutable snapshot of the block at the given location.- Specified by:
getFullBlockin interfaceInputExtent- Overrides:
getFullBlockin classFaweRegionExtent- Parameters:
position- position of the block- Returns:
- the block
-
getFullBlock
- Specified by:
getFullBlockin interfaceInputExtent- Overrides:
getFullBlockin classFaweRegionExtent
-
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 classFaweRegionExtent- 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 classFaweRegionExtent
-
setBlock
public <B extends BlockStateHolder<B>> boolean setBlock(BlockVector3 position, B block) throws WorldEditException 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 classFaweRegionExtent- Throws:
WorldEditException
-
setExtent
- Overrides:
setExtentin classResettableExtent
-
setTile
- Specified by:
setTilein interfaceOutputExtent- 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 classFaweRegionExtent
-
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
-
regenerateChunk
- Specified by:
regenerateChunkin interfaceExtent
-
getHighestTerrainBlock
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) Description copied from interface:ExtentReturns the highest solid 'terrain' (movement-blocking) block.- Specified by:
getHighestTerrainBlockin interfaceExtent- 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.- Specified by:
getHighestTerrainBlockin interfaceExtent- 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'
-
contains
public boolean contains(int x, int z) - Specified by:
containsin classFaweRegionExtent
-
contains
public boolean contains(int x, int y, int z) Description copied from interface:ExtentReturns true if the extent contains the given position- Specified by:
containsin interfaceExtent- Specified by:
containsin classFaweRegionExtent- Parameters:
x- position xy- position yz- position z- Returns:
- if position is contained
-
getRegions
- Specified by:
getRegionsin classFaweRegionExtent
-
commit
Description copied from interface:OutputExtentReturn anOperationthat should be called to tie up loose ends (such as to commit changes in a buffer).- Specified by:
commitin interfaceExtent- Specified by:
commitin interfaceOutputExtent- Overrides:
commitin classAbstractDelegateExtent- Returns:
- an operation or null if there is none to execute
-
cancel
public boolean cancel()- Specified by:
cancelin interfaceExtent- Overrides:
cancelin classAbstractDelegateExtent
-
getMaxY
public int getMaxY()- Specified by:
getMaxYin interfaceExtent- Overrides:
getMaxYin classAbstractDelegateExtent
-
getMinY
public int getMinY()- Specified by:
getMinYin interfaceExtent- Overrides:
getMinYin classAbstractDelegateExtent
-
addProcessor
Description copied from interface:ExtentHave an extent processed - Either block (Extent) processing or chunk processing- Specified by:
addProcessorin interfaceExtent- Overrides:
addProcessorin classAbstractDelegateExtent- Parameters:
processor-- Returns:
- processed Extent
-
addPostProcessor
- Specified by:
addPostProcessorin interfaceExtent- Overrides:
addPostProcessorin classAbstractDelegateExtent
-
lazyCopy
Description copied from interface:ExtentLazily copy a region -
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.- Specified by:
centerin interfaceExtent- 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
-
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.- Specified by:
getNearestSurfaceLayerin interfaceExtent- 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, 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.- Specified by:
getNearestSurfaceTerrainBlockin interfaceExtent- 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.- Specified by:
getNearestSurfaceTerrainBlockin interfaceExtent- 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
- Specified by:
addCavesin interfaceExtent- Throws:
WorldEditException
-
generate
- Specified by:
generatein interfaceExtent- Throws:
WorldEditException
-
addSchems
public void addSchems(Region region, Mask mask, List<ClipboardHolder> clipboards, int rarity, boolean rotate) throws WorldEditException - Specified by:
addSchemsin interfaceExtent- Throws:
WorldEditException
-
spawnResource
public void spawnResource(Region region, Resource gen, int rarity, int frequency) throws WorldEditException - Specified by:
spawnResourcein interfaceExtent- Throws:
WorldEditException
-
addOre
public void addOre(Region region, Mask mask, Pattern material, int size, int frequency, int rarity, int minY, int maxY) throws WorldEditException - Specified by:
addOrein interfaceExtent- Throws:
WorldEditException
-
addOres
- Specified by:
addOresin interfaceExtent- 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
-
processSet
Description copied from interface:IBatchProcessorProcess a chunk that has been set.- Specified by:
processSetin interfaceIBatchProcessor
-
postProcessSet
Description copied from interface:IBatchProcessorPost-process a chunk that has been edited. Set should NOT be modified here, changes will NOT be flushed to the world, but MAY be flushed to history. Defaults to nothing as most Processors will not use it. Post-processors that are not technically blocking should override this method to allow post-processors to become blocking if required.- Specified by:
postProcessSetin interfaceIBatchProcessor
-
postProcess
Description copied from interface:IBatchProcessorPost-process a chunk that has been edited. Set should NOT be modified here, changes will NOT be flushed to the world, but MAY be flushed to history. Defaults to nothing as most Processors will not use it. If the post-processor will run tasks asynchronously/not be blocking, useIBatchProcessor.postProcessSet(com.fastasyncworldedit.core.queue.IChunk, com.fastasyncworldedit.core.queue.IChunkGet, com.fastasyncworldedit.core.queue.IChunkSet)to return a Future.- Specified by:
postProcessin interfaceIBatchProcessor
-
processGet
public boolean processGet(int chunkX, int chunkZ) - Specified by:
processGetin interfaceIBatchProcessor
-
construct
Description copied from interface:IBatchProcessorConvert this processor into an Extent based processor instead of a queue batch based on.- Specified by:
constructin interfaceIBatchProcessor- Overrides:
constructin classFaweRegionExtent
-
getScope
Description copied from interface:IBatchProcessorDefault to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.- Specified by:
getScopein interfaceIBatchProcessor- Overrides:
getScopein classFaweRegionExtent
-