Skip to content

Commit

Permalink
Fix tiny elevators from not working & I forgot the code from Elevator…
Browse files Browse the repository at this point in the history
… constructor that expanded by 1 for the teleportingBoundingBox too.
  • Loading branch information
andrew121410 committed Sep 9, 2024
1 parent 176188e commit d1ffb57
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ public ElevatorMovement(Integer floor, Location atDoor, BoundingBox boundingBox)
this.floor = floor;
this.atDoor = ElevatorFloor.ifIronDoorThenGetBlockUnderTheDoorIfNotThanReturn(atDoor).getLocation();
this.boundingBox = boundingBox;

// See if the bounding box is on the same x or z axis. If so this must be a small elevator.
// So in this case we will expand the bounding box by 1 in all directions, for the teleporting bounding box.
if (this.boundingBox.getMinX() == this.boundingBox.getMaxX() || this.boundingBox.getMinZ() == this.boundingBox.getMaxZ()) {
this.teleportingBoundingBox = this.boundingBox.clone().expand(1);
} else { // This must be a large elevator.
// Expand the bounding box by -1 on the Y axis for minY and +1 on the Y axis for maxY
this.teleportingBoundingBox = this.boundingBox.clone().expand(0, 1, 0);
}
}

/**
Expand Down

0 comments on commit d1ffb57

Please sign in to comment.