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.minecraftforge.common.extensions.IForgeBlockGetter

public class CachingBlockLookup extends Object implements net.minecraft.world.level.BlockGetter
Small block lookup cache, to avoid repeated lookups
  • Constructor Summary

    Constructors
    Constructor
    Description
    CachingBlockLookup(net.minecraft.core.BlockPos center, net.minecraft.world.level.LevelReader world)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.world.level.block.entity.BlockEntity
    getBlockEntity(net.minecraft.core.BlockPos p_45570_)
     
    net.minecraft.world.level.block.state.BlockState
    getBlockState(int x, int y, int z)
    Get a blockstate
    net.minecraft.world.level.block.state.BlockState
    getBlockState(net.minecraft.core.BlockPos pos)
    Get a blockstate
    net.minecraft.world.level.material.FluidState
    getFluidState(net.minecraft.core.BlockPos pos)
     
    int
     
    int
     
    void
    resetToNextPos(int x, int y, int z)
    Resets the cache's position and data

    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.minecraftforge.common.extensions.IForgeBlockGetter

    getExistingBlockEntity, getModelDataManager

    Methods 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:
      getBlockEntity in interface net.minecraft.world.level.BlockGetter
    • getBlockState

      public net.minecraft.world.level.block.state.BlockState getBlockState(net.minecraft.core.BlockPos pos)
      Get a blockstate
      Specified by:
      getBlockState in interface net.minecraft.world.level.BlockGetter
      Parameters:
      pos -
      Returns:
    • getFluidState

      public net.minecraft.world.level.material.FluidState getFluidState(net.minecraft.core.BlockPos pos)
      Specified by:
      getFluidState in interface net.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:
      getHeight in interface net.minecraft.world.level.LevelHeightAccessor
    • getMinBuildHeight

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