java.lang.Object
com.fastasyncworldedit.core.queue.implementation.blocks.NullChunkGet
All Implemented Interfaces:
IBlocks, IChunkGet, ITileInput, Trimable, InputExtent

public final class NullChunkGet extends Object implements IChunkGet
  • Method Details

    • getInstance

      public static NullChunkGet getInstance()
    • getFullBlock

      @Nonnull public BaseBlock getFullBlock(int x, int y, int z)
      Specified by:
      getFullBlock in interface IChunkGet
      Specified by:
      getFullBlock in interface InputExtent
    • getBiomeType

      @Nullable public BiomeType getBiomeType(int x, int y, int z)
      Specified by:
      getBiomeType in interface IBlocks
      Specified by:
      getBiomeType in interface IChunkGet
      Specified by:
      getBiomeType in interface InputExtent
    • removeSectionLighting

      public void removeSectionLighting(int layer, boolean sky)
      Specified by:
      removeSectionLighting in interface IBlocks
    • getBlock

      @Nonnull public BlockState getBlock(int x, int y, int z)
      Specified by:
      getBlock in interface IBlocks
      Specified by:
      getBlock in interface IChunkGet
      Specified by:
      getBlock in interface InputExtent
    • getTiles

      @Nonnull public Map<BlockVector3,CompoundTag> getTiles()
      Specified by:
      getTiles in interface IBlocks
    • getTile

      @Nullable public CompoundTag getTile(int x, int y, int z)
      Specified by:
      getTile in interface IBlocks
      Specified by:
      getTile in interface ITileInput
    • getEntities

      @Nullable public Set<CompoundTag> getEntities()
      Specified by:
      getEntities in interface IBlocks
    • getEntity

      @Nullable public CompoundTag getEntity(@Nonnull UUID uuid)
      Specified by:
      getEntity in interface IChunkGet
    • setCreateCopy

      public void setCreateCopy(boolean createCopy)
      Specified by:
      setCreateCopy in interface IChunkGet
    • isCreateCopy

      public boolean isCreateCopy()
      Specified by:
      isCreateCopy in interface IChunkGet
    • setLightingToGet

      public void setLightingToGet(char[][] lighting, int startSectionIndex, int endSectionIndex)
      Description copied from interface: IChunkGet
      Flush the block lighting array (section*blocks) to the chunk GET between the given section indices. Negative allowed.
      Specified by:
      setLightingToGet in interface IChunkGet
      Parameters:
      lighting - lighting array
      startSectionIndex - lowest section index
      endSectionIndex - highest section index
    • setSkyLightingToGet

      public void setSkyLightingToGet(char[][] lighting, int minSectionPosition, int maxSectionPosition)
      Description copied from interface: IChunkGet
      Flush the sky lighting array (section*blocks) to the chunk GET between the given section indices. Negative allowed.
      Specified by:
      setSkyLightingToGet in interface IChunkGet
      Parameters:
      lighting - sky lighting array
      minSectionPosition - lowest section index
      maxSectionPosition - highest section index
    • setHeightmapToGet

      public void setHeightmapToGet(HeightMapType type, int[] data)
      Specified by:
      setHeightmapToGet in interface IChunkGet
    • getMaxY

      public int getMaxY()
      Description copied from interface: IChunkGet
      Max y value for the chunk's world (inclusive)
      Specified by:
      getMaxY in interface IChunkGet
    • getMinY

      public int getMinY()
      Description copied from interface: IChunkGet
      Min y value for the chunk's world (inclusive)
      Specified by:
      getMinY in interface IChunkGet
    • getMaxSectionPosition

      public int getMaxSectionPosition()
      Description copied from interface: IBlocks
      Get the highest layer position stored in the internal chunk. For 1.16 and below, always returns 15. For 1.17 and above, may not return a value correct to the world if this is a IChunkSet instance, which defaults to 15. For extended height worlds, this will only return over 15 if blocks are stored outside the default range.
      Specified by:
      getMaxSectionPosition in interface IBlocks
    • getMinSectionPosition

      public int getMinSectionPosition()
      Description copied from interface: IBlocks
      Get the lowest layer position stored in the internal chunk. For 1.16 and below, always returns 0. For 1.17 and above, may not return a value correct to the world if this is a IChunkSet instance, which defaults to 0. For extended height worlds, this will only return under 0 if blocks are stored outside the default range.
      Specified by:
      getMinSectionPosition in interface IBlocks
    • trim

      public boolean trim(boolean aggressive)
      Description copied from interface: Trimable
      Trims the object, reducing its memory footprint.
      Specified by:
      trim in interface Trimable
      Parameters:
      aggressive - if trimming should be aggressive e.g., Not returning early when the first element cannot be trimmed
      Returns:
      if this object is empty at the end of the trim, and can therefore be deleted
    • trim

      public boolean trim(boolean aggressive, int layer)
      Specified by:
      trim in interface IBlocks
    • call

      @Nullable public <T extends Future<T>> T call(@Nonnull IChunkSet set, @Nonnull Runnable finalize)
      Specified by:
      call in interface IChunkGet
    • load

      @Nonnull public char[] load(int layer)
      Description copied from interface: IBlocks
      Obtain the specified chunk section stored as an array of ordinals. Uses normal minecraft chunk-section position indices (length 4096). Operations synchronises on the section and will load the section into memory if not present. For chunk GET operations, this will load the data from the world. For chunk SET, this will create a new empty array.
      Specified by:
      load in interface IBlocks
      Parameters:
      layer - chunk section layer (may be negative)
      Returns:
      char array of ordinals of the chunk section
    • loadIfPresent

      @Nullable public char[] loadIfPresent(int layer)
      Description copied from interface: IBlocks
      Obtain the specified chunk section stored as an array of ordinals if present or null. Uses normal minecraft chunk-section position indices (length 4096). Does not synchronise to the section layer as it will not attempt to load into memory.
      Specified by:
      loadIfPresent in interface IBlocks
      Parameters:
      layer - chunk section layer (may be negative)
      Returns:
      char array of ordinals of the chunk section if present
    • hasSection

      public boolean hasSection(int layer)
      Description copied from interface: IBlocks
      Returns if the chunk has a BLOCKS section at the given layer. May not be indicative of presence of entities, tile entites, biomes, etc.
      Specified by:
      hasSection in interface IBlocks
      Parameters:
      layer - chunk section layer
      Returns:
      if blocks/a block section is present
    • getEmittedLight

      public int getEmittedLight(int x, int y, int z)
      Specified by:
      getEmittedLight in interface IChunkGet
      Specified by:
      getEmittedLight in interface InputExtent
    • getSkyLight

      public int getSkyLight(int x, int y, int z)
      Specified by:
      getSkyLight in interface IChunkGet
      Specified by:
      getSkyLight in interface InputExtent
    • getHeightMap

      @Nonnull public int[] getHeightMap(@Nullable HeightMapType type)
      Specified by:
      getHeightMap in interface IChunkGet
      Specified by:
      getHeightMap in interface InputExtent
    • reset

      @Nullable public IBlocks reset()
      Specified by:
      reset in interface IBlocks
    • getSectionCount

      public int getSectionCount()
      Description copied from interface: IBlocks
      Get the number of stored sections
      Specified by:
      getSectionCount in interface IBlocks