mirror of https://github.com/cabaletta/baritone
check chunk load in sepples
This commit is contained in:
parent
e063475ebd
commit
c4f33b72c2
|
@ -77,7 +77,7 @@ allprojects {
|
|||
// The following line declares the yarn mappings you may select this one as well.
|
||||
// mappings "net.fabricmc:yarn:1.17.1+build.32:v2"
|
||||
//launchImplementation('dev.babbaj:nether-pathfinder:1.3.0')
|
||||
implementation 'dev.babbaj:nether-pathfinder:1.3.0'
|
||||
implementation 'dev.babbaj:nether-pathfinder:1.4'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
|
|
|
@ -42,6 +42,7 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
|||
import net.minecraft.world.inventory.ClickType;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.ClipContext;
|
||||
import net.minecraft.world.level.chunk.ChunkSource;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
|
@ -302,7 +303,7 @@ public final class ElytraBehavior implements Helper {
|
|||
|
||||
int rangeStartIncl = playerNear;
|
||||
int rangeEndExcl = playerNear;
|
||||
while (rangeEndExcl < path.size() && ctx.world().isLoaded(path.get(rangeEndExcl))) {
|
||||
while (rangeEndExcl < path.size() && context.hasChunk(new ChunkPos(path.get(rangeEndExcl)))) {
|
||||
rangeEndExcl++;
|
||||
}
|
||||
// rangeEndExcl now represents an index either not in the path, or just outside render distance
|
||||
|
|
|
@ -60,6 +60,10 @@ public final class NetherPathfinderContext {
|
|||
this.executor = Executors.newSingleThreadExecutor();
|
||||
}
|
||||
|
||||
public boolean hasChunk(ChunkPos pos) {
|
||||
return NetherPathfinder.hasChunkFromJava(this.context, pos.x, pos.z);
|
||||
}
|
||||
|
||||
public void queueCacheCulling(int chunkX, int chunkZ, int maxDistanceBlocks, BlockStateOctreeInterface boi) {
|
||||
this.executor.execute(() -> {
|
||||
synchronized (this.cullingLock) {
|
||||
|
|
Loading…
Reference in New Issue