Fix Lure infinite loop (#6850)

This commit is contained in:
HexedHero 2022-01-18 06:54:31 +00:00
parent 756c3377ea
commit a0fb5ba052

View File

@ -36,3 +36,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
public FishingHook(EntityType<? extends FishingHook> 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
}
}