Class RecentTargetCache
java.lang.Object
com.minecolonies.core.entity.pathfinding.RecentTargetCache
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(net.minecraft.core.BlockPos pos, double extraCost) Adds a position that got used as path targetstatic doublegetExtraCost(net.minecraft.core.BlockPos pos) Get the extra cost associated with ending a path at this blockpos
-
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:
-