From d1ffb575007ec941eac4a0965ac9a1dbd488ba44 Mon Sep 17 00:00:00 2001 From: Andrew121410 Date: Mon, 9 Sep 2024 16:26:24 -0400 Subject: [PATCH] Fix tiny elevators from not working & I forgot the code from Elevator constructor that expanded by 1 for the teleportingBoundingBox too. --- .../mc/world16elevators/ElevatorMovement.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/andrew121410/mc/world16elevators/ElevatorMovement.java b/src/main/java/com/andrew121410/mc/world16elevators/ElevatorMovement.java index 2078936..f606082 100644 --- a/src/main/java/com/andrew121410/mc/world16elevators/ElevatorMovement.java +++ b/src/main/java/com/andrew121410/mc/world16elevators/ElevatorMovement.java @@ -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); + } } /**