fix parkour failures at height limit on NCP
This commit is contained in:
		| @@ -94,6 +94,13 @@ public class Settings { | ||||
|      */ | ||||
|     public Setting<Boolean> assumeSafeWalk = new Setting<>(false); | ||||
|  | ||||
|     /** | ||||
|      * If true, parkour is allowed to make jumps when standing on blocks at the maximum height, so player feet is y=256 | ||||
|      * <p> | ||||
|      * Defaults to false because this fails on NCP | ||||
|      */ | ||||
|     public Setting<Boolean> allowJumpAt256 = new Setting<>(false); | ||||
|  | ||||
|     /** | ||||
|      * Blocks that Baritone is allowed to place (as throwaway, for sneak bridging, pillaring, etc.) | ||||
|      */ | ||||
|   | ||||
| @@ -55,6 +55,7 @@ public class CalculationContext { | ||||
|     private final boolean allowBreak; | ||||
|     private final boolean allowParkour; | ||||
|     private final boolean allowParkourPlace; | ||||
|     private final boolean allowJumpAt256; | ||||
|     private final boolean assumeWalkOnWater; | ||||
|     private final int maxFallHeightNoWater; | ||||
|     private final int maxFallHeightBucket; | ||||
| @@ -81,6 +82,7 @@ public class CalculationContext { | ||||
|         this.allowBreak = Baritone.settings().allowBreak.get(); | ||||
|         this.allowParkour = Baritone.settings().allowParkour.get(); | ||||
|         this.allowParkourPlace = Baritone.settings().allowParkourPlace.get(); | ||||
|         this.allowJumpAt256 = Baritone.settings().allowJumpAt256.get(); | ||||
|         this.assumeWalkOnWater = Baritone.settings().assumeWalkOnWater.get(); | ||||
|         this.maxFallHeightNoWater = Baritone.settings().maxFallHeightNoWater.get(); | ||||
|         this.maxFallHeightBucket = Baritone.settings().maxFallHeightBucket.get(); | ||||
| @@ -187,6 +189,10 @@ public class CalculationContext { | ||||
|         return allowParkourPlace; | ||||
|     } | ||||
|  | ||||
|     public boolean allowJumpAt256() { | ||||
|         return allowJumpAt256; | ||||
|     } | ||||
|  | ||||
|     public boolean assumeWalkOnWater() { | ||||
|         return assumeWalkOnWater; | ||||
|     } | ||||
|   | ||||
| @@ -63,6 +63,9 @@ public class MovementParkour extends Movement { | ||||
|         if (!context.allowParkour()) { | ||||
|             return; | ||||
|         } | ||||
|         if (y == 256 && !context.allowJumpAt256()) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         int xDiff = dir.getXOffset(); | ||||
|         int zDiff = dir.getZOffset(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user