Class RecentTargetCache

java.lang.Object
com.minecolonies.core.entity.pathfinding.RecentTargetCache

public class RecentTargetCache extends Object
Small target cache class, which tracks used target positions for some time to have citizens spread out more naturally when a target was recently used.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    add(net.minecraft.core.BlockPos pos, double extraCost)
    Adds a position that got used as path target
    static double
    getExtraCost(net.minecraft.core.BlockPos pos)
    Get the extra cost associated with ending a path at this blockpos

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RecentTargetCache

      public RecentTargetCache()
  • Method Details

    • add

      public static void add(net.minecraft.core.BlockPos pos, double extraCost)
      Adds a position that got used as path target
      Parameters:
      pos -
      extraCost - extra cost assigned to further paths resulting in this pos
    • getExtraCost

      public static double getExtraCost(net.minecraft.core.BlockPos pos)
      Get the extra cost associated with ending a path at this blockpos
      Parameters:
      pos -
      Returns: