Class SanitizerExtent

java.lang.Object
com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
de.eldoria.schematicsanitizer.sanitizer.SanitizerExtent
All Implemented Interfaces:
com.sk89q.worldedit.extent.clipboard.Clipboard, com.sk89q.worldedit.extent.Extent, com.sk89q.worldedit.extent.InputExtent, com.sk89q.worldedit.extent.OutputExtent, Closeable, Flushable, AutoCloseable, Iterable<com.sk89q.worldedit.math.BlockVector3>

public class SanitizerExtent extends com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
An extent which filters the set blocks based on the provided Settings.

It is recommended to use a ForwardExtentCopy to write into it.

 SanitizerExtent sanitizerExtent = new SanitizerExtent(path, clipboard, settings);
 ForwardExtentCopy copy = new ForwardExtentCopy(clipboard, clipboard.getRegion(), sanitizerExtent, clipboard.getMinimumPoint());
 Operations.completeBlindly(copy);
 

The extent will then remove any data.

A report about the removed data can be retrieved with report()

What the extent will do:

What the extent won't do:

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard

    com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard.ClipboardEntity
  • Constructor Summary

    Constructors
    Constructor
    Description
    SanitizerExtent(Path path, com.sk89q.worldedit.extent.clipboard.Clipboard base, Settings settings)
    Creates a new extent
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable com.sk89q.worldedit.entity.Entity
    createEntity(com.sk89q.worldedit.util.Location location, com.sk89q.worldedit.entity.BaseEntity entity)
     
    @Nullable com.sk89q.worldedit.entity.Entity
    createEntity(com.sk89q.worldedit.util.Location location, com.sk89q.worldedit.entity.BaseEntity entity, UUID uuid)
     
     
    report(Path newPath)
     
    <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>>
    boolean
    setBlock(int x, int y, int z, B block)
     
    <T extends com.sk89q.worldedit.world.block.BlockStateHolder<T>>
    boolean
    setBlock(com.sk89q.worldedit.math.BlockVector3 position, T block)
     
    <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>>
    int
    setBlocks(com.sk89q.worldedit.regions.Region region, B block)
     
    int
    setBlocks(com.sk89q.worldedit.regions.Region region, com.sk89q.worldedit.function.pattern.Pattern pattern)
     
    int
    setBlocks(Set<com.sk89q.worldedit.math.BlockVector3> vset, com.sk89q.worldedit.function.pattern.Pattern pattern)
     
    boolean
    setTile(int x, int y, int z, com.sk89q.jnbt.CompoundTag tag)
     

    Methods inherited from class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard

    close, flush, getBiome, getBiomeType, getBlock, getBlock, getDimensions, getEntities, getEntities, getFullBlock, getFullBlock, getMaximumPoint, getMinimumPoint, getOrigin, getParent, getRegion, hasBiomes, iterator, iterator, iterator2d, removeEntity, removeEntity, setBiome, setBiome, setOrigin, setTile

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.sk89q.worldedit.extent.clipboard.Clipboard

    apply, getArea, getHeight, getLength, getURI, getVolume, getWidth, paste, paste, paste, paste, paste, paste, save, save, transform

    Methods inherited from interface com.sk89q.worldedit.extent.Extent

    addCaves, addOre, addOres, addPostProcessor, addProcessor, addSchems, apply, cancel, center, commit, contains, contains, countBlocks, countBlocks, disableHistory, disableQueue, enableHistory, enableQueue, generate, getBlockDistribution, getBlockDistributionWithData, getHighestTerrainBlock, getHighestTerrainBlock, getMaxY, getMinY, getNearestSurfaceLayer, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, getNearestSurfaceTerrainBlock, isQueueEnabled, isWorld, lazyCopy, regenerateChunk, relight, relightBlock, relightSky, replaceBlocks, replaceBlocks, replaceBlocks, spawnResource

    Methods inherited from interface com.sk89q.worldedit.extent.InputExtent

    getBiome, getBrightness, getBrightness, getEmittedLight, getEmittedLight, getHeightMap, getOpacity, getOpacity, getSkyLight, getSkyLight

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface com.sk89q.worldedit.extent.OutputExtent

    fullySupports3DBiomes, setBiome, setBlockLight, setBlockLight, setHeightMap, setSkyLight, setSkyLight
  • Constructor Details

    • SanitizerExtent

      public SanitizerExtent(Path path, com.sk89q.worldedit.extent.clipboard.Clipboard base, Settings settings)
      Creates a new extent
      Parameters:
      path - path of the file used in the report
      base - the clipboard which will be copied
      settings - settings for filtering
  • Method Details

    • report

      public SanitizerReport report(Path newPath)
    • report

      public SanitizerReport report()
    • setTile

      public boolean setTile(int x, int y, int z, com.sk89q.jnbt.CompoundTag tag)
      Specified by:
      setTile in interface com.sk89q.worldedit.extent.OutputExtent
      Overrides:
      setTile in class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
    • setBlock

      public <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block)
      Specified by:
      setBlock in interface com.sk89q.worldedit.extent.OutputExtent
      Overrides:
      setBlock in class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
    • createEntity

      @Nullable public @Nullable com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, com.sk89q.worldedit.entity.BaseEntity entity)
      Specified by:
      createEntity in interface com.sk89q.worldedit.extent.Extent
      Overrides:
      createEntity in class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
    • createEntity

      @Nullable public @Nullable com.sk89q.worldedit.entity.Entity createEntity(com.sk89q.worldedit.util.Location location, com.sk89q.worldedit.entity.BaseEntity entity, UUID uuid)
      Specified by:
      createEntity in interface com.sk89q.worldedit.extent.Extent
      Overrides:
      createEntity in class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
    • setBlocks

      public <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>> int setBlocks(com.sk89q.worldedit.regions.Region region, B block) throws com.sk89q.worldedit.MaxChangedBlocksException
      Throws:
      com.sk89q.worldedit.MaxChangedBlocksException
    • setBlocks

      public int setBlocks(com.sk89q.worldedit.regions.Region region, com.sk89q.worldedit.function.pattern.Pattern pattern) throws com.sk89q.worldedit.MaxChangedBlocksException
      Throws:
      com.sk89q.worldedit.MaxChangedBlocksException
    • setBlocks

      public int setBlocks(Set<com.sk89q.worldedit.math.BlockVector3> vset, com.sk89q.worldedit.function.pattern.Pattern pattern)
    • setBlock

      public <T extends com.sk89q.worldedit.world.block.BlockStateHolder<T>> boolean setBlock(com.sk89q.worldedit.math.BlockVector3 position, T block) throws com.sk89q.worldedit.WorldEditException
      Specified by:
      setBlock in interface com.sk89q.worldedit.extent.OutputExtent
      Overrides:
      setBlock in class com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard
      Throws:
      com.sk89q.worldedit.WorldEditException