This commit is contained in:
Leijurv 2023-06-17 20:03:30 -07:00
parent fcf8cd35d2
commit fef7ba4701
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 10 additions and 9 deletions

View File

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

View File

@ -160,9 +160,9 @@ public final class ElytraBehavior extends Behavior implements Helper {
private Vec3d pathAt(int i) { private Vec3d pathAt(int i) {
return new Vec3d( return new Vec3d(
this.path.get(i).x + 0.5, this.path.get(i).x,
this.path.get(i).y + 0.5, this.path.get(i).y,
this.path.get(i).z + 0.5 this.path.get(i).z
); );
} }
@ -326,7 +326,7 @@ public final class ElytraBehavior extends Behavior implements Helper {
final int playerNear = this.pathManager.getNear(); final int playerNear = this.pathManager.getNear();
this.visiblePath = path.subList( this.visiblePath = path.subList(
Math.max(playerNear - 30, 0), Math.max(playerNear - 30, 0),
Math.min(playerNear + 30, path.size()) Math.min(playerNear + 100, path.size())
); );
if (!ctx.player().isElytraFlying()) { if (!ctx.player().isElytraFlying()) {
@ -429,7 +429,7 @@ public final class ElytraBehavior extends Behavior implements Helper {
} }
final AxisAlignedBB bb = ctx.player().getEntityBoundingBox().grow(growAmount); final AxisAlignedBB bb = ctx.player().getEntityBoundingBox().grow(growAmount);
final Vec3d[] corners = new Vec3d[] { final Vec3d[] corners = new Vec3d[]{
new Vec3d(bb.minX, bb.minY, bb.minZ), new Vec3d(bb.minX, bb.minY, bb.minZ),
new Vec3d(bb.minX, bb.minY, bb.maxZ), new Vec3d(bb.minX, bb.minY, bb.maxZ),
new Vec3d(bb.minX, bb.maxY, bb.minZ), new Vec3d(bb.minX, bb.maxY, bb.minZ),
@ -479,7 +479,7 @@ public final class ElytraBehavior extends Behavior implements Helper {
totalMotion = totalMotion.add(stepped); totalMotion = totalMotion.add(stepped);
Vec3d actualPosition = ctx.playerFeetAsVec().add(totalMotion); Vec3d actualPosition = ctx.playerFeetAsVec().add(totalMotion);
for (int x = MathHelper.floor(Math.min(actualPosition.x, actualPositionPrevTick.x) - 0.31); x <= Math.max(actualPosition.x, actualPositionPrevTick.x) + 0.31; x++) { for (int x = MathHelper.floor(Math.min(actualPosition.x, actualPositionPrevTick.x) - 0.31); x <= Math.max(actualPosition.x, actualPositionPrevTick.x) + 0.31; x++) {
for (int y = MathHelper.floor(Math.min(actualPosition.y, actualPositionPrevTick.y) - 0.2); y <= Math.max(actualPosition.y, actualPositionPrevTick.y) + 0.8; y++) { for (int y = MathHelper.floor(Math.min(actualPosition.y, actualPositionPrevTick.y) - 0.2); y <= Math.max(actualPosition.y, actualPositionPrevTick.y) + 1; y++) {
for (int z = MathHelper.floor(Math.min(actualPosition.z, actualPositionPrevTick.z) - 0.31); z <= Math.max(actualPosition.z, actualPositionPrevTick.z) + 0.31; z++) { for (int z = MathHelper.floor(Math.min(actualPosition.z, actualPositionPrevTick.z) - 0.31); z <= Math.max(actualPosition.z, actualPositionPrevTick.z) + 0.31; z++) {
if (!passable(bsi.get0(x, y, z))) { if (!passable(bsi.get0(x, y, z))) {
continue outer; continue outer;

View File

@ -56,7 +56,8 @@ public final class NetherPathfinderContext {
NetherPathfinder.pathFind( NetherPathfinder.pathFind(
this.context, this.context,
src.getX(), src.getY(), src.getZ(), src.getX(), src.getY(), src.getZ(),
dst.getX(), dst.getY(), dst.getZ() dst.getX(), dst.getY(), dst.getZ(),
true
), this.executor); ), this.executor);
} }