java.lang.Object
com.minecolonies.core.entity.pathfinding.world.ChunkCache
All Implemented Interfaces:
net.minecraft.world.level.biome.BiomeManager.NoiseBiomeSource, net.minecraft.world.level.BlockAndTintGetter, net.minecraft.world.level.BlockGetter, net.minecraft.world.level.CollisionGetter, net.minecraft.world.level.LevelHeightAccessor, net.minecraft.world.level.LevelReader, net.minecraft.world.level.SignalGetter, net.minecraftforge.client.extensions.IForgeBlockAndTintGetter, net.minecraftforge.common.extensions.IForgeBlockGetter

public class ChunkCache extends Object implements net.minecraft.world.level.LevelReader
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected net.minecraft.world.level.chunk.LevelChunk[][]
     
    protected int
     
    protected int
     
    protected boolean
    set by !chunk.getAreLevelsEmpty
    protected net.minecraft.world.level.Level
    Reference to the World object.

    Fields inherited from interface net.minecraft.world.level.SignalGetter

    DIRECTIONS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChunkCache(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos posFromIn, net.minecraft.core.BlockPos posToIn)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull net.minecraft.world.level.dimension.DimensionType
     
    net.minecraft.world.flag.FeatureFlagSet
     
    net.minecraft.world.level.biome.BiomeManager
     
    net.minecraft.world.level.block.entity.BlockEntity
    getBlockEntity(@NotNull net.minecraft.core.BlockPos pos)
     
    @NotNull net.minecraft.world.level.block.state.BlockState
    getBlockState(net.minecraft.core.BlockPos pos)
     
    net.minecraft.world.level.chunk.ChunkAccess
    getChunk(int x, int z, net.minecraft.world.level.chunk.ChunkStatus requiredStatus, boolean nonnull)
     
    int
    getDirectSignal(net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
     
    List<net.minecraft.world.phys.shapes.VoxelShape>
    getEntityCollisions(@Nullable net.minecraft.world.entity.Entity p_186427_, net.minecraft.world.phys.AABB p_186428_)
     
    net.minecraft.world.level.material.FluidState
    getFluidState(net.minecraft.core.BlockPos pos)
     
    int
    getHeight(net.minecraft.world.level.levelgen.Heightmap.Types heightmapType, int x, int z)
     
    net.minecraft.core.BlockPos
    getHeightmapPos(net.minecraft.world.level.levelgen.Heightmap.Types heightmapType, net.minecraft.core.BlockPos pos)
     
    net.minecraft.world.level.lighting.LevelLightEngine
     
    int
     
    int
     
    int
     
    float
    getShade(net.minecraft.core.Direction direction, boolean b)
     
    int
     
    net.minecraft.world.level.block.entity.BlockEntity
    getTileEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk.EntityCreationType createType)
     
    net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>
    getUncachedNoiseBiome(int x, int y, int z)
     
    net.minecraft.world.level.border.WorldBorder
     
    boolean
    hasChunk(int chunkX, int chunkZ)
     
    boolean
     
    boolean
    set by !chunk.getAreLevelsEmpty
    boolean
    isEmptyBlock(net.minecraft.core.BlockPos pos)
    Checks to see if an air block exists at the provided location.
    boolean
    isUnobstructed(net.minecraft.world.entity.Entity entityIn, net.minecraft.world.phys.shapes.VoxelShape shape)
     
    net.minecraft.core.RegistryAccess
     

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.world.level.BlockAndTintGetter

    canSeeSky, getBrightness, getRawBrightness

    Methods inherited from interface net.minecraft.world.level.BlockGetter

    clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLine

    Methods inherited from interface net.minecraft.world.level.CollisionGetter

    collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, isUnobstructed, isUnobstructed, noCollision, noCollision, noCollision

    Methods inherited from interface net.minecraftforge.client.extensions.IForgeBlockAndTintGetter

    getShade

    Methods inherited from interface net.minecraftforge.common.extensions.IForgeBlockGetter

    getExistingBlockEntity, getModelDataManager

    Methods inherited from interface net.minecraft.world.level.LevelHeightAccessor

    getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight

    Methods inherited from interface net.minecraft.world.level.LevelReader

    canSeeSkyFromBelowWater, containsAnyLiquid, getBiome, getBlockStatesIfLoaded, getBlockTint, getChunk, getChunk, getChunk, getChunkForCollisions, getHeight, getLightLevelDependentMagicValue, getMaxLocalRawBrightness, getMaxLocalRawBrightness, getNoiseBiome, getPathfindingCostFromLightLevels, hasChunkAt, hasChunkAt, hasChunksAt, hasChunksAt, hasChunksAt, holderLookup, isAreaLoaded, isWaterAt

    Methods inherited from interface net.minecraft.world.level.SignalGetter

    getBestNeighborSignal, getControlInputSignal, getDirectSignalTo, getSignal, hasNeighborSignal, hasSignal
  • Field Details

    • chunkX

      protected int chunkX
    • chunkZ

      protected int chunkZ
    • chunkArray

      protected net.minecraft.world.level.chunk.LevelChunk[][] chunkArray
    • empty

      protected boolean empty
      set by !chunk.getAreLevelsEmpty
    • world

      protected net.minecraft.world.level.Level world
      Reference to the World object.
  • Constructor Details

    • ChunkCache

      public ChunkCache(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos posFromIn, net.minecraft.core.BlockPos posToIn)
  • Method Details

    • isEmpty

      public boolean isEmpty()
      set by !chunk.getAreLevelsEmpty
      Returns:
      if so.
    • getBlockEntity

      @Nullable public net.minecraft.world.level.block.entity.BlockEntity getBlockEntity(@NotNull @NotNull net.minecraft.core.BlockPos pos)
      Specified by:
      getBlockEntity in interface net.minecraft.world.level.BlockGetter
    • getTileEntity

      @Nullable public net.minecraft.world.level.block.entity.BlockEntity getTileEntity(net.minecraft.core.BlockPos pos, net.minecraft.world.level.chunk.LevelChunk.EntityCreationType createType)
    • getMinBuildHeight

      public int getMinBuildHeight()
      Specified by:
      getMinBuildHeight in interface net.minecraft.world.level.LevelHeightAccessor
      Specified by:
      getMinBuildHeight in interface net.minecraft.world.level.LevelReader
    • getMaxBuildHeight

      public int getMaxBuildHeight()
      Specified by:
      getMaxBuildHeight in interface net.minecraft.world.level.LevelHeightAccessor
    • getBlockState

      @NotNull public @NotNull net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.BlockPos pos)
      Specified by:
      getBlockState in interface net.minecraft.world.level.BlockGetter
    • getFluidState

      public net.minecraft.world.level.material.FluidState getFluidState(net.minecraft.core.BlockPos pos)
      Specified by:
      getFluidState in interface net.minecraft.world.level.BlockGetter
    • getUncachedNoiseBiome

      public net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> getUncachedNoiseBiome(int x, int y, int z)
      Specified by:
      getUncachedNoiseBiome in interface net.minecraft.world.level.LevelReader
    • isEmptyBlock

      public boolean isEmptyBlock(net.minecraft.core.BlockPos pos)
      Checks to see if an air block exists at the provided location. Note that this only checks to see if the blocks material is set to air, meaning it is possible for non-vanilla blocks to still pass this check.
      Specified by:
      isEmptyBlock in interface net.minecraft.world.level.LevelReader
    • getChunk

      @Nullable public net.minecraft.world.level.chunk.ChunkAccess getChunk(int x, int z, net.minecraft.world.level.chunk.ChunkStatus requiredStatus, boolean nonnull)
      Specified by:
      getChunk in interface net.minecraft.world.level.LevelReader
    • hasChunk

      public boolean hasChunk(int chunkX, int chunkZ)
      Specified by:
      hasChunk in interface net.minecraft.world.level.LevelReader
    • getHeightmapPos

      public net.minecraft.core.BlockPos getHeightmapPos(net.minecraft.world.level.levelgen.Heightmap.Types heightmapType, net.minecraft.core.BlockPos pos)
      Specified by:
      getHeightmapPos in interface net.minecraft.world.level.LevelReader
    • getHeight

      public int getHeight(net.minecraft.world.level.levelgen.Heightmap.Types heightmapType, int x, int z)
      Specified by:
      getHeight in interface net.minecraft.world.level.LevelReader
    • getSkyDarken

      public int getSkyDarken()
      Specified by:
      getSkyDarken in interface net.minecraft.world.level.LevelReader
    • getBiomeManager

      public net.minecraft.world.level.biome.BiomeManager getBiomeManager()
      Specified by:
      getBiomeManager in interface net.minecraft.world.level.LevelReader
    • getWorldBorder

      public net.minecraft.world.level.border.WorldBorder getWorldBorder()
      Specified by:
      getWorldBorder in interface net.minecraft.world.level.CollisionGetter
    • isUnobstructed

      public boolean isUnobstructed(@Nullable net.minecraft.world.entity.Entity entityIn, net.minecraft.world.phys.shapes.VoxelShape shape)
      Specified by:
      isUnobstructed in interface net.minecraft.world.level.CollisionGetter
    • getEntityCollisions

      public List<net.minecraft.world.phys.shapes.VoxelShape> getEntityCollisions(@Nullable @Nullable net.minecraft.world.entity.Entity p_186427_, net.minecraft.world.phys.AABB p_186428_)
      Specified by:
      getEntityCollisions in interface net.minecraft.world.level.CollisionGetter
    • getDirectSignal

      public int getDirectSignal(net.minecraft.core.BlockPos pos, net.minecraft.core.Direction direction)
      Specified by:
      getDirectSignal in interface net.minecraft.world.level.SignalGetter
    • registryAccess

      public net.minecraft.core.RegistryAccess registryAccess()
      Specified by:
      registryAccess in interface net.minecraft.world.level.LevelReader
    • enabledFeatures

      public net.minecraft.world.flag.FeatureFlagSet enabledFeatures()
      Specified by:
      enabledFeatures in interface net.minecraft.world.level.LevelReader
    • isClientSide

      public boolean isClientSide()
      Specified by:
      isClientSide in interface net.minecraft.world.level.LevelReader
    • getSeaLevel

      public int getSeaLevel()
      Specified by:
      getSeaLevel in interface net.minecraft.world.level.LevelReader
    • dimensionType

      @NotNull public @NotNull net.minecraft.world.level.dimension.DimensionType dimensionType()
      Specified by:
      dimensionType in interface net.minecraft.world.level.LevelReader
    • getShade

      public float getShade(net.minecraft.core.Direction direction, boolean b)
      Specified by:
      getShade in interface net.minecraft.world.level.BlockAndTintGetter
    • getLightEngine

      public net.minecraft.world.level.lighting.LevelLightEngine getLightEngine()
      Specified by:
      getLightEngine in interface net.minecraft.world.level.BlockAndTintGetter