Class ChunkCache

java.lang.Object
me.desht.pneumaticcraft.common.util.ChunkCache
All Implemented Interfaces:
net.minecraft.world.level.BlockGetter, net.minecraft.world.level.CollisionGetter, net.minecraft.world.level.LevelHeightAccessor, net.minecraftforge.common.extensions.IForgeBlockGetter

public class ChunkCache extends Object implements net.minecraft.world.level.CollisionGetter
Like a Region, but should be OK to use get a cache from a different thread (since we go through ServerChunkProvider#getChunk(), which returns async chunk supplier when called off the main thread. This should only be used server-side.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final net.minecraft.world.level.chunk.ChunkAccess[][]
     
    protected final int
     
    protected final int
     
    protected boolean
     
    protected final net.minecraft.world.level.Level
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.block.entity.BlockEntity
    getBlockEntity(net.minecraft.core.BlockPos pos)
     
    net.minecraft.world.level.block.state.BlockState
    getBlockState(net.minecraft.core.BlockPos pos)
     
    net.minecraft.world.level.BlockGetter
    getChunkForCollisions(int chunkX, int chunkZ)
     
    List<net.minecraft.world.phys.shapes.VoxelShape>
    getEntityCollisions(net.minecraft.world.entity.Entity pEntity, net.minecraft.world.phys.AABB pCollisionBox)
     
    net.minecraft.world.level.material.FluidState
    getFluidState(net.minecraft.core.BlockPos pos)
     
    int
     
    int
     
    net.minecraft.world.level.border.WorldBorder
     

    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.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, isUnobstructed, noCollision, noCollision, noCollision

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

    getExistingBlockEntity, getModelDataManager

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

    getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
  • Field Details

    • chunkX

      protected final int chunkX
    • chunkZ

      protected final int chunkZ
    • chunks

      protected final net.minecraft.world.level.chunk.ChunkAccess[][] chunks
    • empty

      protected boolean empty
    • world

      protected final net.minecraft.world.level.Level world
  • Constructor Details

    • ChunkCache

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

    • getWorldBorder

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

      public net.minecraft.world.level.BlockGetter getChunkForCollisions(int chunkX, int chunkZ)
      Specified by:
      getChunkForCollisions in interface net.minecraft.world.level.CollisionGetter
    • getEntityCollisions

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

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

      public 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
    • getHeight

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

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