From 15a38c4871caac7329da9e90869133cebccdeaaf Mon Sep 17 00:00:00 2001 From: Babbaj Date: Sun, 13 Aug 2023 21:58:07 -0400 Subject: [PATCH] add setting that makes unknown chunks air --- build.gradle | 4 ++-- src/api/java/baritone/api/Settings.java | 6 ++++++ .../baritone/process/elytra/NetherPathfinderContext.java | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index accb7ca54..0c8e58364 100755 --- a/build.gradle +++ b/build.gradle @@ -175,8 +175,8 @@ dependencies { transitive = false } launchAnnotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor' - launchImplementation('dev.babbaj:nether-pathfinder:0.41') - implementation 'dev.babbaj:nether-pathfinder:0.41' + launchImplementation('dev.babbaj:nether-pathfinder:1.2') + implementation 'dev.babbaj:nether-pathfinder:1.2' testImplementation 'junit:junit:4.12' } diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index aeaa55542..076f8f395 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -1404,6 +1404,12 @@ public final class Settings { */ public final Setting elytraNetherSeed = new Setting<>(146008555100680L); + /** + * Whether nether-pathfinder should generate terrain based on {@link #elytraNetherSeed}. + * If false all chunks that haven't been loaded are assumed to be air. + */ + public final Setting elytraPredictTerrain = new Setting<>(true); + /** * Automatically swap the current elytra with a new one when the durability gets too low */ diff --git a/src/main/java/baritone/process/elytra/NetherPathfinderContext.java b/src/main/java/baritone/process/elytra/NetherPathfinderContext.java index 991457d10..93e0587f0 100644 --- a/src/main/java/baritone/process/elytra/NetherPathfinderContext.java +++ b/src/main/java/baritone/process/elytra/NetherPathfinderContext.java @@ -17,6 +17,7 @@ package baritone.process.elytra; +import baritone.Baritone; import baritone.api.event.events.BlockChangeEvent; import baritone.utils.accessor.IBitArray; import baritone.utils.accessor.IBlockStateContainer; @@ -103,7 +104,9 @@ public final class NetherPathfinderContext { src.getX(), src.getY(), src.getZ(), dst.getX(), dst.getY(), dst.getZ(), true, - 10000 + false, + 10000, + !Baritone.settings().elytraPredictTerrain.value ); if (segment == null) { throw new PathCalculationException("Path calculation failed");