/** * If null path or reached the end. */ @Override public boolean noPath() { return future == null && super.noPath(); }
@Override public final boolean shouldExecute() { PathNavigateGround pathnavigate = (PathNavigateGround) this.theEntity.getNavigator(); if (!pathnavigate.getEnterDoors() || pathnavigate.noPath()) return false; Path path = pathnavigate.getPath(); if (path == null) { return false; } if (addDoorCloseOnThePath(path)) return true; if (!this.theEntity.collidedHorizontally) return false; BlockPos potentialDoorPos = new BlockPos(MathHelper.floor(this.theEntity.posX), MathHelper.floor(this.theEntity.posY), MathHelper.floor(this.theEntity.posZ)); return findDoor(potentialDoorPos) || findDoor(potentialDoorPos.up()); }