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
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 -
Constructor Summary
ConstructorsConstructorDescriptionChunkCache(net.minecraft.world.level.Level worldIn, net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.entity.BlockEntitygetBlockEntity(net.minecraft.core.BlockPos pos) net.minecraft.world.level.block.state.BlockStategetBlockState(net.minecraft.core.BlockPos pos) net.minecraft.world.level.BlockGettergetChunkForCollisions(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.FluidStategetFluidState(net.minecraft.core.BlockPos pos) intintnet.minecraft.world.level.border.WorldBorderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.level.BlockGetter
clip, clipWithInteractionOverride, getBlockEntity, getBlockFloorHeight, getBlockFloorHeight, getBlockStates, getLightEmission, getMaxLightLevel, isBlockInLineMethods inherited from interface net.minecraft.world.level.CollisionGetter
collidesWithSuffocatingBlock, findFreePosition, findSupportingBlock, getBlockCollisions, getCollisions, isUnobstructed, isUnobstructed, isUnobstructed, noCollision, noCollision, noCollisionMethods inherited from interface net.minecraftforge.common.extensions.IForgeBlockGetter
getExistingBlockEntity, getModelDataManagerMethods 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:
getWorldBorderin interfacenet.minecraft.world.level.CollisionGetter
-
getChunkForCollisions
public net.minecraft.world.level.BlockGetter getChunkForCollisions(int chunkX, int chunkZ) - Specified by:
getChunkForCollisionsin interfacenet.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:
getEntityCollisionsin interfacenet.minecraft.world.level.CollisionGetter
-
getBlockEntity
@Nullable public net.minecraft.world.level.block.entity.BlockEntity getBlockEntity(net.minecraft.core.BlockPos pos) - Specified by:
getBlockEntityin interfacenet.minecraft.world.level.BlockGetter
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.BlockPos pos) - Specified by:
getBlockStatein interfacenet.minecraft.world.level.BlockGetter
-
getFluidState
public net.minecraft.world.level.material.FluidState getFluidState(net.minecraft.core.BlockPos pos) - Specified by:
getFluidStatein interfacenet.minecraft.world.level.BlockGetter
-
getHeight
public int getHeight()- Specified by:
getHeightin interfacenet.minecraft.world.level.LevelHeightAccessor
-
getMinBuildHeight
public int getMinBuildHeight()- Specified by:
getMinBuildHeightin interfacenet.minecraft.world.level.LevelHeightAccessor
-