Skip to content

Commit

Permalink
Fix #337
Browse files Browse the repository at this point in the history
  • Loading branch information
Roadhog360 committed Sep 25, 2023
1 parent c636160 commit eeb38bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ public PathEntity getPathToEntityLiving(Entity p_75494_1_) {

public PathEntity getEntityPathToXYZ(double toPosX, double toPosY, double toPosZ, float searchRange, boolean canBreakDoors, boolean canEnterDoors, boolean avoidsWater, boolean canSwim, double xOffset, double yOffset, double zOffset) {
worldObj.theProfiler.startSection("pathfind");
int l = MathHelper.floor_double(theEntity.posX + xOffset);
int i1 = MathHelper.floor_double(theEntity.posY + yOffset);
int j1 = MathHelper.floor_double(theEntity.posZ + zOffset);
int k1 = (int) (searchRange);
int l1 = l - k1;
int i2 = i1 - k1;
int j2 = j1 - k1;
int k2 = l + k1;
int l2 = i1 + k1;
int i3 = j1 + k1;
// int l = MathHelper.floor_double(theEntity.posX + xOffset);
// int i1 = MathHelper.floor_double(theEntity.posY + yOffset);
// int j1 = MathHelper.floor_double(theEntity.posZ + zOffset);
// int k1 = (int) (searchRange);
// int l1 = l - k1;
// int i2 = i1 - k1;
// int j2 = j1 - k1;
// int k2 = l + k1;
// int l2 = i1 + k1;
// int i3 = j1 + k1;
// ChunkCache chunkcache = new ChunkCache(worldObj, l1, i2, j2, k2, l2, i3, 0);
PathEntity pathentity = pathFinder.createEntityPathTo(theEntity, toPosX, toPosY, toPosZ, searchRange);
worldObj.theProfiler.endSection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public int findPathOptions(Entity entity, PathPoint currentPoint, PathPoint offs
}

private boolean isSafe(PathPoint p_227476_1_) {
return p_227476_1_ != null && costMalusMap.get(p_227476_1_) >= 0.0F;
return p_227476_1_ != null && costMalusMap.getOrDefault(p_227476_1_, 0.0F) >= 0.0F;
}

private boolean hasNotVisited(PathPoint p_227477_1_) {
Expand Down

0 comments on commit eeb38bc

Please sign in to comment.