Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,12 @@ allprojects {
}
}
mavenCentral()
maven {
name = 'babbaj-repo'
url = 'https://babbaj.github.io/maven/'
}
}

dependencies {
compileOnly "org.spongepowered:mixin:${project.mixin_version}"
compileOnly "org.ow2.asm:asm:${project.asm_version}"

implementation "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"

implementation 'com.google.code.findbugs:jsr305:3.0.2'
}

Expand Down
1 change: 0 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ dependencies {
common sourceSet.output
shadowCommon sourceSet.output
}
include "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
}

processResources {
Expand Down
1 change: 0 additions & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ dependencies {
common sourceSet.output
shadowCommon sourceSet.output
}
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
}

processResources {
Expand Down
2 changes: 0 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ neoforge_version=9-beta

fabric_version=0.16.9

nether_pathfinder_version=1.6

// These dependencies are used for common and tweaker
// while mod loaders usually ship their own version
mixin_version=0.8.5
Expand Down
1 change: 0 additions & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ dependencies {
common sourceSet.output
shadowCommon sourceSet.output
}
shadowCommon "dev.babbaj:nether-pathfinder:${project.nether_pathfinder_version}"
}

processResources {
Expand Down
5 changes: 0 additions & 5 deletions scripts/proguard.pro
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@
-dontwarn baritone.utils.schematic.schematica.**
-dontwarn baritone.utils.schematic.litematica.**

# nether-pathfinder uses JNI to acess its own classes
# and some of our builds include it before running proguard
# conservatively keep all of it, even though only PathSegment.<init> is needed
-keep,allowoptimization class dev.babbaj.pathfinder.** { *; }

# Keep - Applications. Keep all application classes, along with their 'main'
# methods.
-keepclasseswithmembers public class * {
Expand Down
4 changes: 0 additions & 4 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1549,10 +1549,6 @@ public final class Settings {
*/
public final Setting<Boolean> elytraChatSpam = new Setting<>(false);

/**
* May reduce memory usage by using a custom allocator for pathfinding
*/
public final Setting<Boolean> elytraCustomAllocator = new Setting<>(true);

/**
* Allow the pathfinder to attempt flight in tighter spaces, useful in caves but can be dangerous.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/baritone/cache/CachedRegion.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class CachedRegion implements ICachedRegion {
/**
* Magic value to detect invalid cache files, or incompatible cache files saved in an old version of Baritone
*/
private static final int CACHED_REGION_MAGIC = 456022911;
public static final int CACHED_REGION_MAGIC = 456022911;

/**
* All of the chunks in this region: A 32x32 array of them.
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/baritone/process/ElytraProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ private ElytraProcess(Baritone baritone) {
}

public static IElytraProcess create(final Baritone baritone) {
return NetherPathfinderContext.isSupported()
? new ElytraProcess(baritone)
: new NullElytraProcess(baritone);
return new ElytraProcess(baritone);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,28 @@

package baritone.process.elytra;

import dev.babbaj.pathfinder.NetherPathfinder;
import dev.babbaj.pathfinder.Octree;
import net.minecraft.world.level.dimension.DimensionType;
import baritone.process.elytra.pathfinder.Chunk;
import baritone.process.elytra.pathfinder.NetherPathfinder;

/**
* @author Brady
*/
public final class BlockStateOctreeInterface {

private final NetherPathfinderContext context;
private final long contextPtr;
private final NetherPathfinder pathfinder;
private final int minY;
transient long chunkPtr;
// The chunk the last lookup fell in, so that a run of lookups inside one chunk costs one table
// lookup. Cleared under the write lock by whatever replaces or culls chunks.
Chunk chunk;

// Guarantee that the first lookup will fetch the context by setting MAX_VALUE
private int prevChunkX = Integer.MAX_VALUE;
private int prevChunkZ = Integer.MAX_VALUE;

public BlockStateOctreeInterface(final NetherPathfinderContext context) {
this.context = context;
this.contextPtr = context.context;
this.pathfinder = context.context;
this.minY = context.minY;
}

Expand All @@ -48,11 +49,11 @@ public boolean get0(final int x, final int y, final int z) {
}
final int chunkX = x >> 4;
final int chunkZ = z >> 4;
if (this.chunkPtr == 0 | ((chunkX ^ this.prevChunkX) | (chunkZ ^ this.prevChunkZ)) != 0) {
if (this.chunk == null | ((chunkX ^ this.prevChunkX) | (chunkZ ^ this.prevChunkZ)) != 0) {
this.prevChunkX = chunkX;
this.prevChunkZ = chunkZ;
this.chunkPtr = NetherPathfinder.getChunkOrDefault(this.contextPtr, chunkX, chunkZ, true);
this.chunk = this.pathfinder.getChunkOrDefault(chunkX, chunkZ, true);
}
return Octree.getBlock(this.chunkPtr, x & 0xF, adjustedY, z & 0xF);
return this.chunk.isSolid(x & 0xF, adjustedY, z & 0xF);
}
}
Loading