Skip to content

Commit

Permalink
Backport changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Aug 22, 2022
1 parent 479e350 commit 4347901
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Expand Up @@ -450,9 +450,9 @@ protected void l() {
Vec3D var0 = b();
this.l = (this.a.getWidth() > 0.75F) ? (this.a.getWidth() / 2.0F) : (0.75F - this.a.getWidth() / 2.0F);
BaseBlockPosition var1 = this.c.g();
double var2 = Math.abs(this.a.locX() - var1.getX() + 0.5D);
double var2 = Math.abs(this.a.locX() - (var1.getX() + 0.5D));
double var4 = Math.abs(this.a.locY() - var1.getY());
double var6 = Math.abs(this.a.locZ() - var1.getZ() + 0.5D);
double var6 = Math.abs(this.a.locZ() - (var1.getZ() + 0.5D));
boolean var8 = (var2 < this.l && var6 < this.l && var4 < 1.0D);
boolean b2 = Math.abs(this.a.locX() - (var1.getX() + 0.5D)) < this.l
&& Math.abs(this.a.locZ() - (var1.getZ() + 0.5D)) < this.l
Expand Down
Expand Up @@ -137,8 +137,8 @@ private boolean canWalkAbove(int var0, int var1, int var2, int var3, int var4, i
double var9) {
for (BlockPos var12 : BlockPos.betweenClosed(new BlockPos(var0, var1, var2),
new BlockPos(var0 + var3 - 1, var1 + var4 - 1, var2 + var5 - 1))) {
double var13 = var12.getX() + 0.5D - var6.x;
double var15 = var12.getZ() + 0.5D - var6.z;
double var13 = (var12.getX() + 0.5D) - var6.x;
double var15 = (var12.getZ() + 0.5D) - var6.z;
if (var13 * var7 + var15 * var9 < 0.0D)
continue;
if (!this.level.getBlockState(var12).isPathfindable(this.level, var12, PathComputationType.LAND))
Expand All @@ -155,8 +155,8 @@ private boolean canWalkOn(int var0, int var1, int var2, int var3, int var4, int
return false;
for (int var13 = var11; var13 < var11 + var3; var13++) {
for (int var14 = var12; var14 < var12 + var5; var14++) {
double var15 = var13 + 0.5D - var6.x;
double var17 = var14 + 0.5D - var6.z;
double var15 = (var13 + 0.5D) - var6.x;
double var17 = (var14 + 0.5D) - var6.z;
if (var15 * var7 + var17 * var9 >= 0.0D) {
BlockPathTypes var19 = this.nodeEvaluator.getBlockPathType(this.level, var13, var1 - 1, var14,
this.mob, var3, var4, var5, true, true);
Expand Down Expand Up @@ -282,9 +282,9 @@ protected void followThePath() {
this.maxDistanceToWaypoint = (this.mob.getBbWidth() > 0.75F) ? (this.mob.getBbWidth() / 2.0F)
: (0.75F - this.mob.getBbWidth() / 2.0F);
BlockPos blockPos = this.path.getNextNodePos();
double var2 = Math.abs(this.mob.getX() - blockPos.getX() + 0.5D);
double var2 = Math.abs(this.mob.getX() - (blockPos.getX() + 0.5D));
double var4 = Math.abs(this.mob.getY() - blockPos.getY());
double var6 = Math.abs(this.mob.getZ() - blockPos.getZ() + 0.5D);
double var6 = Math.abs(this.mob.getZ() - (blockPos.getZ() + 0.5D));
boolean var8 = (var2 < this.maxDistanceToWaypoint && var6 < this.maxDistanceToWaypoint && var4 < 1.0D);
if (var8 || (this.mob.canCutCorner((this.path.getNextNode()).type) && shouldTargetNextNodeInDirection(var0)))
this.path.advance();
Expand Down
Expand Up @@ -147,7 +147,7 @@ private boolean canWalkAbove(int var0, int var1, int var2, int var3, int var4, i
}
return true;
}
private boolean canWalkOn(int var0, int var1, int var2, int var3, int var4, int var5, Vec3 var6, double var7,
double var9) {
int var11 = var0 - var3 / 2;
Expand Down Expand Up @@ -283,9 +283,9 @@ protected void followThePath() {
this.maxDistanceToWaypoint = (this.mob.getBbWidth() > 0.75F) ? (this.mob.getBbWidth() / 2.0F)
: (0.75F - this.mob.getBbWidth() / 2.0F);
BlockPos blockPos = this.path.getNextNodePos();
double var2 = Math.abs(this.mob.getX() - blockPos.getX() + 0.5D);
double var2 = Math.abs(this.mob.getX() - (blockPos.getX() + 0.5D));
double var4 = Math.abs(this.mob.getY() - blockPos.getY());
double var6 = Math.abs(this.mob.getZ() - blockPos.getZ() + 0.5D);
double var6 = Math.abs(this.mob.getZ() - (blockPos.getZ() + 0.5D));
boolean var8 = (var2 < this.maxDistanceToWaypoint && var6 < this.maxDistanceToWaypoint && var4 < 1.0D);
if (var8 || (this.mob.canCutCorner((this.path.getNextNode()).type) && shouldTargetNextNodeInDirection(var0)))
this.path.advance();
Expand Down
Expand Up @@ -250,8 +250,8 @@ private boolean b(int paramInt1, int paramInt2, int paramInt3, int paramInt4, in
Vec3D paramVec3D, double paramDouble1, double paramDouble2) {
for (BlockPosition localBlockPosition : BlockPosition.a(new BlockPosition(paramInt1, paramInt2, paramInt3),
new BlockPosition(paramInt1 + paramInt4 - 1, paramInt2 + paramInt5 - 1, paramInt3 + paramInt6 - 1))) {
double d1 = localBlockPosition.getX() + 0.5D - paramVec3D.a;
double d2 = localBlockPosition.getZ() + 0.5D - paramVec3D.c;
double d1 = (localBlockPosition.getX() + 0.5D) - paramVec3D.a;
double d2 = (localBlockPosition.getZ() + 0.5D) - paramVec3D.c;
if (d1 * paramDouble1 + d2 * paramDouble2 >= 0.0D) {
Block localBlock = this.c.getType(localBlockPosition).getBlock();
if (!localBlock.b(this.c, localBlockPosition)) {
Expand Down

0 comments on commit 4347901

Please sign in to comment.