Class CachingBlockLookup
java.lang.Object
com.minecolonies.core.entity.pathfinding.world.CachingBlockLookup
- All Implemented Interfaces:
net.minecraft.world.level.BlockGetter,net.minecraft.world.level.LevelHeightAccessor,net.neoforged.neoforge.common.extensions.IBlockGetterExtension
Small block lookup cache, to avoid repeated lookups
-
Constructor Summary
ConstructorsConstructorDescriptionCachingBlockLookup(net.minecraft.core.BlockPos center, net.minecraft.world.level.LevelReader world) -
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.level.block.entity.BlockEntitygetBlockEntity(net.minecraft.core.BlockPos p_45570_) net.minecraft.world.level.block.state.BlockStategetBlockState(int x, int y, int z) Get a blockstatenet.minecraft.world.level.block.state.BlockStategetBlockState(net.minecraft.core.BlockPos pos) Get a blockstatenet.minecraft.world.level.material.FluidStategetFluidState(net.minecraft.core.BlockPos pos) intintvoidresetToNextPos(int x, int y, int z) Resets the cache's position and dataMethods 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.neoforged.neoforge.common.extensions.IBlockGetterExtension
getAuxLightManager, getAuxLightManager, getModelDataMethods inherited from interface net.minecraft.world.level.LevelHeightAccessor
getMaxBuildHeight, getMaxSection, getMinSection, getSectionIndex, getSectionIndexFromSectionY, getSectionsCount, getSectionYFromSectionIndex, isOutsideBuildHeight, isOutsideBuildHeight
-
Constructor Details
-
CachingBlockLookup
public CachingBlockLookup(net.minecraft.core.BlockPos center, net.minecraft.world.level.LevelReader world)
-
-
Method Details
-
getBlockEntity
@Nullable public @Nullable net.minecraft.world.level.block.entity.BlockEntity getBlockEntity(net.minecraft.core.BlockPos p_45570_) - Specified by:
getBlockEntityin interfacenet.minecraft.world.level.BlockGetter
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.BlockPos pos) Get a blockstate- Specified by:
getBlockStatein interfacenet.minecraft.world.level.BlockGetter- Parameters:
pos-- Returns:
-
getFluidState
public net.minecraft.world.level.material.FluidState getFluidState(net.minecraft.core.BlockPos pos) - Specified by:
getFluidStatein interfacenet.minecraft.world.level.BlockGetter
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState(int x, int y, int z) Get a blockstate- Parameters:
x-y-z-- Returns:
-
resetToNextPos
public void resetToNextPos(int x, int y, int z) Resets the cache's position and data -
getHeight
public int getHeight()- Specified by:
getHeightin interfacenet.minecraft.world.level.LevelHeightAccessor
-
getMinBuildHeight
public int getMinBuildHeight()- Specified by:
getMinBuildHeightin interfacenet.minecraft.world.level.LevelHeightAccessor
-