Skip to content

Commit

Permalink
Fixed SneakAndPlaceTask
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Zangl committed Dec 27, 2015
1 parent 2dfdc07 commit d5b1cd5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,17 @@ protected boolean faceWhileSneaking() {
}

protected boolean isFacingRightBlock(AIHelper h) {
return h.isFacingBlock(getFromPos(), inDirection);
return h.isFacingBlock(getPositionToPlaceOn(), inDirection);
}

protected boolean faceBlock(AIHelper h, TaskOperations o) {
return h.faceSideOf(getFromPos(), inDirection);
return h.faceSideOf(getPositionToPlaceOn(), inDirection);
}

protected BlockPos getPositionToPlaceOn() {
return startStandPosition.add(0, -1, 0);
}

protected BlockPos getFromPos() {
return startStandPosition;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public AITask getPlaceBlockTask(BlockPos relativeFromPos) {
return new UpwardsMoveTask(forPosition.add(0, 1, 0), blockFilter);
} else {
return new SneakAndPlaceTask(forPosition.add(0, 1, 0), blockFilter,
relativeFromPos, getMinHeightToBuild());
forPosition.add(relativeFromPos), getMinHeightToBuild());
}
}

Expand Down

0 comments on commit d5b1cd5

Please sign in to comment.