Fix simulation not respecting `ignoreLava`

This commit is contained in:
Brady 2023-07-09 09:12:21 -07:00
parent c0cdfb7781
commit 7a935fb2ea
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 5 additions and 5 deletions

View File

@ -175,9 +175,9 @@ dependencies {
transitive = false
}
launchAnnotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor'
launchImplementation('dev.babbaj:nether-pathfinder:0.21')
launchImplementation('dev.babbaj:nether-pathfinder:0.22')
testImplementation 'junit:junit:4.12'
implementation 'dev.babbaj:nether-pathfinder:0.21'
implementation 'dev.babbaj:nether-pathfinder:0.22'
}
mixin {

View File

@ -386,7 +386,7 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
@Override
public void onChunkEvent(ChunkEvent event) {
if (event.isPostPopulate()) {
if (event.isPostPopulate() && this.context != null) {
final Chunk chunk = ctx.world().getChunk(event.getX(), event.getZ());
this.context.queueForPacking(chunk);
}
@ -1069,13 +1069,13 @@ public final class ElytraBehavior extends Behavior implements IElytraBehavior, H
// Ensure that the goal is visible along the entire simulated path
// Reverse order iteration since the last position is most likely to fail
for (int i = result.steps.size() - 1; i >= 1; i--) {
if (!clearView(context.start.add(result.steps.get(i)), goal, false)) {
if (!clearView(context.start.add(result.steps.get(i)), goal, context.ignoreLava)) {
continue outer;
}
}
} else {
// Ensure that the goal is visible from the final position
if (!clearView(context.start.add(result.steps.get(result.steps.size() - 1)), goal, false)) {
if (!clearView(context.start.add(result.steps.get(result.steps.size() - 1)), goal, context.ignoreLava)) {
continue;
}
}