Interface Filter
- All Known Subinterfaces:
BlockStateHolder<B>
,ExtentPattern
,IDelegateFilter
,Pattern
,RegionFunction
- All Known Implementing Classes:
AbstractExtentPattern
,AbstractExtentPattern
,AbstractPattern
,AngleColorPattern
,AnglePattern
,AverageColorPattern
,BaseBlock
,BiomeApplyingPattern
,BiomeCopy
,BiomeReplace
,BlanketBaseBlock
,BlockDistributionCounter
,BlockPattern
,BlockReplace
,BlockState
,BlockType
,BufferedPattern
,BufferedPattern2D
,ClipboardPattern
,CombinedBlockCopy
,CombinedRegionFunction
,Counter
,CountFilter
,DelegateFilter
,DesaturatePattern
,DistrFilter
,ExistingPattern
,ExpressionPattern
,ExtentBiomeCopy
,ExtentBlockCopy
,ExtentBufferedCompositePattern
,FloraGenerator
,ForestGenerator
,ForgetfulExtentBuffer
,ForkedFilter
,FuzzyBlockState
,GardenPatchGenerator
,IntersectRegionFunction
,ItemUseFunction
,Linear2DBlockPattern
,Linear3DBlockPattern
,LinearBlockPattern
,LinkedFilter
,MaskedPattern
,MaskFilter
,MaskingExtent
,MobSpawnerBlock
,NoXPattern
,NoYPattern
,NoZPattern
,NullRegionFunction
,OffsetPattern
,RandomFullClipboardPattern
,RandomOffsetPattern
,RandomPattern
,RandomStatePattern
,RegionMaskingFilter
,RegionMaskTestFunction
,RegionOffset
,RelativePattern
,RepeatingExtentPattern
,SaturatePattern
,ShadePattern
,SignBlock
,SimpleBlockCopy
,SkullBlock
,SolidRandomOffsetPattern
,StateApplyingPattern
,SurfaceRandomOffsetPattern
,TypeApplyingPattern
,WaterloggedRemover
public interface Filter
A filter is an interface used for setting blocks.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
appliesChunk
(@org.jetbrains.annotations.Range(from=0L, to=15L) int chunkX, @org.jetbrains.annotations.Range(from=0L, to=15L) int chunkZ) Checks whether a chunk should be read.default boolean
appliesLayer
(IChunk chunk, int layer) default void
applyBlock
(FilterBlock block) Make changes to the block here
- e.g., block.setId(...)
- Note: Performance is critical heredefault <T extends IChunk>
TapplyChunk
(T chunk, Region region) Do something with the IChunk
- Return null if you don't want to filter blocks
- Return the chunk if you do want to filter blocksdefault void
finishChunk
(IChunk chunk) Do something with the IChunk after block filtering.default Filter
fork()
Fork this for use by another thread - Typically filters are simple and don't need to create another copy to be thread safe heredefault void
join()
-
Method Details
-
appliesChunk
default boolean appliesChunk(@org.jetbrains.annotations.Range(from=0L, to=15L) int chunkX, @org.jetbrains.annotations.Range(from=0L, to=15L) int chunkZ) Checks whether a chunk should be read.- Parameters:
chunkX
- the x coordinate in the chunkchunkZ
- the z coordinate in the chunk
-
applyChunk
Do something with the IChunk
- Return null if you don't want to filter blocks
- Return the chunk if you do want to filter blocks -
appliesLayer
-
applyBlock
Make changes to the block here
- e.g., block.setId(...)
- Note: Performance is critical here -
finishChunk
Do something with the IChunk after block filtering. -
fork
Fork this for use by another thread - Typically filters are simple and don't need to create another copy to be thread safe here- Returns:
- this
-
join
default void join()
-