Class FaweRegionExtent

All Implemented Interfaces:
IBatchProcessor, Extent, InputExtent, OutputExtent, Serializable
Direct Known Subclasses:
HeightBoundExtent, MultiRegionExtent, NullExtent, SingleRegionExtent

public abstract class FaweRegionExtent extends ResettableExtent implements IBatchProcessor
See Also:
  • Constructor Details

    • FaweRegionExtent

      public FaweRegionExtent(Extent extent, FaweLimit limit)
      Create a new instance.
      Parameters:
      extent - the extent
  • Method Details

    • contains

      public abstract boolean contains(int x, int y, int z)
      Description copied from interface: Extent
      Returns true if the extent contains the given position
      Specified by:
      contains in interface Extent
      Parameters:
      x - position x
      y - position y
      z - position z
      Returns:
      if position is contained
    • contains

      public abstract boolean contains(int x, int z)
    • getRegions

      public abstract Collection<Region> getRegions()
    • isGlobal

      public boolean isGlobal()
    • construct

      public Extent construct(Extent child)
      Description copied from interface: IBatchProcessor
      Convert this processor into an Extent based processor instead of a queue batch based on.
      Specified by:
      construct in interface IBatchProcessor
    • contains

      public final boolean contains(BlockVector3 p)
      Description copied from interface: Extent
      Returns true if the extent contains the given position
      Specified by:
      contains in interface Extent
      Parameters:
      p - position
      Returns:
      if position is contained
    • contains

      public final boolean contains(BlockVector2 p)
    • setBlock

      public <B extends BlockStateHolder<B>> boolean setBlock(int x, int y, int z, B block) throws WorldEditException
      Specified by:
      setBlock in interface OutputExtent
      Overrides:
      setBlock in class AbstractDelegateExtent
      Throws:
      WorldEditException
    • setBiome

      public boolean setBiome(int x, int y, int z, BiomeType biome)
      Specified by:
      setBiome in interface OutputExtent
      Overrides:
      setBiome in class AbstractDelegateExtent
    • getBiome

      public BiomeType getBiome(BlockVector3 position)
      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 interface InputExtent
      Overrides:
      getBiome in class AbstractDelegateExtent
      Parameters:
      position - the (x, y, z) location to check the biome at
      Returns:
      the biome at the location
      See Also:
    • getBiomeType

      public BiomeType getBiomeType(int x, int y, int z)
      Specified by:
      getBiomeType in interface InputExtent
      Overrides:
      getBiomeType in class AbstractDelegateExtent
    • getFullBlock

      public BaseBlock getFullBlock(BlockVector3 position)
      Description copied from interface: InputExtent
      Get an immutable snapshot of the block at the given location.
      Specified by:
      getFullBlock in interface InputExtent
      Overrides:
      getFullBlock in class AbstractDelegateExtent
      Parameters:
      position - position of the block
      Returns:
      the block
    • getBlock

      public BlockState getBlock(BlockVector3 position)
      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 Patterns and so on.

      Specified by:
      getBlock in interface InputExtent
      Overrides:
      getBlock in class AbstractDelegateExtent
      Parameters:
      position - position of the block
      Returns:
      the block
    • createEntity

      @Nullable public Entity createEntity(Location location, BaseEntity entity)
      Description copied from interface: Extent
      Create an entity at the given location.
      Specified by:
      createEntity in interface Extent
      Overrides:
      createEntity in class AbstractDelegateExtent
      Parameters:
      location - the location
      entity - the entity
      Returns:
      a reference to the created entity, or null if the entity could not be created
    • getScope

      public ProcessorScope 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 interface IBatchProcessor