add settings for pathing hashmap
This commit is contained in:
		@@ -193,6 +193,18 @@ public class Settings {
 | 
			
		||||
     */
 | 
			
		||||
    public Setting<Integer> planningTickLookAhead = new Setting<>(100);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Default size of the Long2ObjectOpenHashMap used in pathing
 | 
			
		||||
     */
 | 
			
		||||
    public Setting<Integer> pathingMapDefaultSize = new Setting<>(1024);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Load factor coefficient for the Long2ObjectOpenHashMap used in pathing
 | 
			
		||||
     * <p>
 | 
			
		||||
     * Decrease for faster map operations, but higher memory usage
 | 
			
		||||
     */
 | 
			
		||||
    public Setting<Float> pathingMapLoadFactor = new Setting<>(0.75f);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * How far are you allowed to fall onto solid ground (without a water bucket)?
 | 
			
		||||
     * 3 won't deal any damage. But if you just want to get down the mountain quickly and you have
 | 
			
		||||
 
 | 
			
		||||
@@ -17,6 +17,7 @@
 | 
			
		||||
 | 
			
		||||
package baritone.pathing.calc;
 | 
			
		||||
 | 
			
		||||
import baritone.Baritone;
 | 
			
		||||
import baritone.api.pathing.goals.Goal;
 | 
			
		||||
import baritone.pathing.path.IPath;
 | 
			
		||||
import baritone.utils.pathing.BetterBlockPos;
 | 
			
		||||
@@ -71,7 +72,7 @@ public abstract class AbstractNodeCostSearch implements IPathFinder {
 | 
			
		||||
    AbstractNodeCostSearch(BlockPos start, Goal goal) {
 | 
			
		||||
        this.start = new BetterBlockPos(start.getX(), start.getY(), start.getZ());
 | 
			
		||||
        this.goal = goal;
 | 
			
		||||
        this.map = new Long2ObjectOpenHashMap<>();
 | 
			
		||||
        this.map = new Long2ObjectOpenHashMap<>(Baritone.settings().pathingMapDefaultSize.value, Baritone.settings().pathingMapLoadFactor.get());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void cancel() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user