From f2aae99f9063e77d1c74b10eaa2678ac6740d5bc Mon Sep 17 00:00:00 2001 From: Violet-Nonbloosom <86547296+Violet-Nonbloosom@users.noreply.github.com> Date: Thu, 28 Mar 2024 00:04:30 +0800 Subject: [PATCH] Update src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java Co-authored-by: JustAHuman-xD <65748158+JustAHuman-xD@users.noreply.github.com> --- .../slimefun4/api/gps/TeleportationManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java index 7331b70ddf..530966b0a3 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/gps/TeleportationManager.java @@ -167,10 +167,10 @@ public int getTeleportationTime(int complexity, @Nonnull Location source, @Nonnu // If speed is greater than distance, ultimate time cost must be 1 tick. // Otherwise, speed WON'T overflow the range of int. - if (speed <= distance) - time = Math.min(distance / (int)speed, 40); - - return time; + if (speed <= distance) { + return Math.min(distance / (int) speed, 40); + } + return 1; } @ParametersAreNonnullByDefault