Class OncePerChunkExtent
- All Implemented Interfaces:
IBatchProcessor
,Extent
,InputExtent
,OutputExtent
- Since:
- 2.13.0
-
Field Summary
Fields inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
extent
-
Constructor Summary
ConstructorsConstructorDescriptionOncePerChunkExtent
(Extent extent, IQueueExtent<IQueueChunk> queue, Consumer<IChunkGet> task) Create a new instance. -
Method Summary
Modifier and TypeMethodDescription@Nullable Extent
Convert this processor into an Extent based processor instead of a queue batch based on.getBiome
(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.int
getBrightness
(int x, int y, int z) int
getEmittedLight
(int x, int y, int z) getFullBlock
(int x, int y, int z) getFullBlock
(BlockVector3 position) Get an immutable snapshot of the block at the given location.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.int
getSkyLight
(int x, int y, int z) getTask()
Get the task run once per chunk.processGet
(IChunkGet get) Process a chunk GET.processSet
(IChunk chunk, IChunkGet get, IChunkSet set) Process a chunk that has been set.void
reset()
Reset the chunks visitedboolean
boolean
setBiome
(BlockVector3 position, BiomeType biome) Set the biome.void
setBlockLight
(int x, int y, int z, int value) void
setSkyLight
(int x, int y, int z, int value) void
Set the task to be run once per chunkMethods inherited from class com.sk89q.worldedit.extent.AbstractDelegateExtent
addPostProcessor, addProcessor, apply, cancel, commit, commitBefore, countBlocks, countBlocks, createEntity, createEntity, disableHistory, disableQueue, enableQueue, fullySupports3DBiomes, getBlockDistribution, getBlockDistributionWithData, getEntities, getEntities, getExtent, getMaximumPoint, getMaxY, getMinimumPoint, getMinY, isQueueEnabled, isWorld, relight, relightBlock, relightSky, removeEntity, replaceBlocks, replaceBlocks, replaceBlocks, setBlock, setBlock, setBlocks, setBlocks, setBlocks, setChangeSet, tile, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.extent.Extent
addCaves, addOre, addOres, addSchems, apply, center, contains, contains, enableHistory, generate, getHighestTerrainBlock, getHighestTerrainBlock, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, lazyCopy, regenerateChunk, spawnResource
Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, postProcess, postProcessSet, processGet, remove, trimNBT, trimNBT, trimY
Methods inherited from interface com.sk89q.worldedit.extent.InputExtent
getBiome, getBrightness, getEmittedLight, getHeightMap, getOpacity, getOpacity, getSkyLight
Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent
setBiome, setBlockLight, setHeightMap, setSkyLight, setTile
-
Constructor Details
-
OncePerChunkExtent
public OncePerChunkExtent(@Nonnull Extent extent, @Nonnull IQueueExtent<IQueueChunk> queue, @Nonnull Consumer<IChunkGet> task) Create a new instance.- Parameters:
extent
- the extentqueue
- Queue to load chunk GET from if acting as extent not processortask
- Consumer task for the chunk GET- Since:
- 2.13.0
-
-
Method Details
-
getTask
Get the task run once per chunk. -
setTask
Set the task to be run once per chunk -
processSet
Description copied from interface:IBatchProcessor
Process a chunk that has been set.- Specified by:
processSet
in interfaceIBatchProcessor
-
processGet
Description copied from interface:IBatchProcessor
Process a chunk GET. Method typically only called when a chunk is loaded into memory (miss fromcache
).- Specified by:
processGet
in interfaceIBatchProcessor
- Parameters:
get
- GET chunk loaded- Returns:
- processed get chunk
-
construct
Description copied from interface:IBatchProcessor
Convert this processor into an Extent based processor instead of a queue batch based on.- Specified by:
construct
in interfaceIBatchProcessor
-
getScope
Description copied from interface:IBatchProcessor
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.- Specified by:
getScope
in interfaceIBatchProcessor
-
getBlock
Description copied from interface:InputExtent
Get 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,
null
should 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
Pattern
s and so on.- Specified by:
getBlock
in interfaceInputExtent
- Overrides:
getBlock
in classAbstractDelegateExtent
- Parameters:
position
- position of the block- Returns:
- the block
-
getBlock
- Specified by:
getBlock
in interfaceInputExtent
- Overrides:
getBlock
in classAbstractDelegateExtent
-
getFullBlock
Description copied from interface:InputExtent
Get an immutable snapshot of the block at the given location.- Specified by:
getFullBlock
in interfaceInputExtent
- Overrides:
getFullBlock
in classAbstractDelegateExtent
- Parameters:
position
- position of the block- Returns:
- the block
-
getFullBlock
- Specified by:
getFullBlock
in interfaceInputExtent
- Overrides:
getFullBlock
in classAbstractDelegateExtent
-
getBiomeType
- Specified by:
getBiomeType
in interfaceInputExtent
- Overrides:
getBiomeType
in classAbstractDelegateExtent
-
getBiome
Description copied from interface:InputExtent
Get 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:
getBiome
in interfaceInputExtent
- Overrides:
getBiome
in classAbstractDelegateExtent
- Parameters:
position
- the (x, y, z) location to check the biome at- Returns:
- the biome at the location
- See Also:
-
getEmittedLight
public int getEmittedLight(int x, int y, int z) - Specified by:
getEmittedLight
in interfaceInputExtent
- Overrides:
getEmittedLight
in classAbstractDelegateExtent
-
getSkyLight
public int getSkyLight(int x, int y, int z) - Specified by:
getSkyLight
in interfaceInputExtent
- Overrides:
getSkyLight
in classAbstractDelegateExtent
-
getBrightness
public int getBrightness(int x, int y, int z) - Specified by:
getBrightness
in interfaceInputExtent
- Overrides:
getBrightness
in classAbstractDelegateExtent
-
setBiome
- Specified by:
setBiome
in interfaceOutputExtent
- Overrides:
setBiome
in classAbstractDelegateExtent
-
setBiome
Description copied from interface:OutputExtent
Set 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:
setBiome
in interfaceOutputExtent
- Overrides:
setBiome
in 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)
-
setBlockLight
public void setBlockLight(int x, int y, int z, int value) - Specified by:
setBlockLight
in interfaceOutputExtent
- Overrides:
setBlockLight
in classAbstractDelegateExtent
-
setSkyLight
public void setSkyLight(int x, int y, int z, int value) - Specified by:
setSkyLight
in interfaceOutputExtent
- Overrides:
setSkyLight
in classAbstractDelegateExtent
-
reset
public void reset()Reset the chunks visited
-