add setting that makes unknown chunks air

This commit is contained in:
Babbaj 2023-08-13 21:58:07 -04:00
parent 70640246b6
commit 15a38c4871
No known key found for this signature in database
GPG Key ID: F044309848A07CAC
3 changed files with 12 additions and 3 deletions

View File

@ -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'
}

View File

@ -1404,6 +1404,12 @@ public final class Settings {
*/
public final Setting<Long> 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<Boolean> elytraPredictTerrain = new Setting<>(true);
/**
* Automatically swap the current elytra with a new one when the durability gets too low
*/

View File

@ -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");