java.lang.Object
org.cloudburstmc.server.level.generator.standard.biome.map.CachingBiomeMap
All Implemented Interfaces:
BiomeMap, GenerationPass

public final class CachingBiomeMap extends Object implements BiomeMap
Implementation of BiomeMap which caches the biomes looked up at a given position.
Author:
DaPorkchop_
  • Constructor Details

    • CachingBiomeMap

      public CachingBiomeMap(BiomeMap delegate)
    • CachingBiomeMap

      public CachingBiomeMap(@NonNull @NonNull BiomeMap delegate, int maxCacheSize)
  • Method Details

    • get

      public GenerationBiome get(int x, int z)
      Description copied from interface: BiomeMap
      Gets the GenerationBiome at the given world coordinates.
      Specified by:
      get in interface BiomeMap
      Parameters:
      x - the X coordinate
      z - the Z coordinate
      Returns:
      the GenerationBiome at the given coordinates
    • getRegion

      public GenerationBiome[] getRegion(GenerationBiome[] arr, int x, int z, int sizeX, int sizeZ)
      Description copied from interface: BiomeMap
      Gets the GenerationBiomes in the given world region.
      Specified by:
      getRegion in interface BiomeMap
      Parameters:
      arr - the GenerationBiome[] to fill. A new array will be created if this array is null or too small
      x - the region's base X coordinate
      z - the region's base Z coordinate
      sizeX - the size of the region along the X axis
      sizeZ - the size of the region along the Z axis Gets the GenerationBiomes in the given world region.
    • getRegionIds

      public org.cloudburstmc.api.util.Identifier[] getRegionIds(org.cloudburstmc.api.util.Identifier[] arr, int x, int z, int sizeX, int sizeZ)
      Description copied from interface: BiomeMap
      Gets the Identifiers of the biomes in the given world region.
      Specified by:
      getRegionIds in interface BiomeMap
      Parameters:
      arr - the Identifier[] to fill. A new array will be created if this array is null or too small
      x - the region's base X coordinate
      z - the region's base Z coordinate
      sizeX - the size of the region along the X axis
      sizeZ - the size of the region along the Z axis Gets the Identifiers in the given world region.
    • needsCaching

      public boolean needsCaching()
      Specified by:
      needsCaching in interface BiomeMap
      Returns:
      whether or not this BiomeMap's results should be cached for performance
    • possibleBiomes

      public Set<GenerationBiome> possibleBiomes()
      Specified by:
      possibleBiomes in interface BiomeMap
      Returns:
      a Set containing all of the biomes that could be returned by this BiomeMap
    • getId

      public org.cloudburstmc.api.util.Identifier getId()
      Specified by:
      getId in interface BiomeMap
      Specified by:
      getId in interface GenerationPass
      Returns:
      the identifier of this generation pass