Skip to content

Commit

Permalink
Fixed ending the flight early placing the TARDIS at the wrong location (
Browse files Browse the repository at this point in the history
  • Loading branch information
Auroali authored Jul 5, 2024
1 parent 46cf59b commit 20f13cb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,9 @@ private void endFlightEarly(boolean dramatic) {
BlockPos targetPosition = this.targetLocation.getPosition();
BlockPos startingPosition = this.getCurrentLocation().getPosition();
float percentage = this.getFlightPercentageCovered();
float percentageX = (targetPosition.getX() - startingPosition.getX()) * percentage;
float percentageY = (targetPosition.getY() - startingPosition.getY()) * percentage;
float percentageZ = (targetPosition.getZ() - startingPosition.getZ()) * percentage;
float percentageX = startingPosition.getX() + (targetPosition.getX() - startingPosition.getX()) * percentage;
float percentageY = startingPosition.getY() + (targetPosition.getY() - startingPosition.getY()) * percentage;
float percentageZ = startingPosition.getZ() + (targetPosition.getZ() - startingPosition.getZ()) * percentage;

TardisNavLocation newLocation = new TardisNavLocation(new BlockPos((int) percentageX, (int) percentageY, (int) percentageZ), this.targetLocation.getDirection(), percentage > 0.49f ? this.targetLocation.getLevel() : this.getCurrentLocation().getLevel());
this.targetLocation = newLocation;
Expand Down

0 comments on commit 20f13cb

Please sign in to comment.