From a0fb5ba052aa6df25518e285824f8453e5209395 Mon Sep 17 00:00:00 2001 From: HexedHero <6012891+HexedHero@users.noreply.github.com> Date: Tue, 18 Jan 2022 06:54:31 +0000 Subject: [PATCH] Fix Lure infinite loop (#6850) --- patches/server/Configurable-fishing-time-ranges.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/server/Configurable-fishing-time-ranges.patch b/patches/server/Configurable-fishing-time-ranges.patch index 7b0a7599ea..8c2eda9f4e 100644 --- a/patches/server/Configurable-fishing-time-ranges.patch +++ b/patches/server/Configurable-fishing-time-ranges.patch @@ -36,3 +36,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public FishingHook(EntityType type, Level world) { +@@ -0,0 +0,0 @@ public class FishingHook extends Projectile { + } else { + // CraftBukkit start - logic to modify fishing wait time + this.timeUntilLured = Mth.nextInt(this.random, this.minWaitTime, this.maxWaitTime); +- this.timeUntilLured -= (this.applyLure) ? this.lureSpeed * 20 * 5 : 0; ++ this.timeUntilLured -= (this.applyLure) ? (this.lureSpeed * 20 * 5 >= this.maxWaitTime ? this.timeUntilLured - 1 : this.lureSpeed * 20 * 5) : 0; // Paper - Fix Lure infinite loop + // CraftBukkit end + } + }