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 Type
    Method
    Description
    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.
    default boolean
    appliesLayer(IChunk chunk, int layer)
     
    default void
    Make changes to the block here
    - e.g., block.setId(...)
    - Note: Performance is critical here
    default <T extends IChunk>
    T
    applyChunk(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 blocks
    default void
    Do something with the IChunk after block filtering.
    default Filter
    Fork this for use by another thread - Typically filters are simple and don't need to create another copy to be thread safe here
    default void
     
  • 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 chunk
      chunkZ - the z coordinate in the chunk
    • applyChunk

      default <T extends IChunk> T applyChunk(T chunk, @Nullable 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 blocks
    • appliesLayer

      default boolean appliesLayer(IChunk chunk, int layer)
    • applyBlock

      default void applyBlock(FilterBlock block)
      Make changes to the block here
      - e.g., block.setId(...)
      - Note: Performance is critical here
    • finishChunk

      default void finishChunk(IChunk chunk)
      Do something with the IChunk after block filtering.
    • fork

      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 here
      Returns:
      this
    • join

      default void join()