mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 08:57:35 +01:00
Fix Lure infinite loop (#6850)
This commit is contained in:
parent
60b7d5ee0c
commit
17e1f65669
@ -22,7 +22,7 @@ index ec3fb557fa31b153de20c4990066182a774dd489..5896b4e4646d722db5622a424fa26f42
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
index 73c5a0e6f1db6bf438fe516e213f40f0645ed954..dc248a0a91795fb67cc0e15cb0012364e739fbaa 100644
|
||||
index 73c5a0e6f1db6bf438fe516e213f40f0645ed954..b11f97e4ecc8d623d8a8a69e9e7a6205b96072f1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
|
||||
@@ -82,6 +82,10 @@ public class FishingHook extends Projectile {
|
||||
@ -36,3 +36,12 @@ index 73c5a0e6f1db6bf438fe516e213f40f0645ed954..dc248a0a91795fb67cc0e15cb0012364
|
||||
}
|
||||
|
||||
public FishingHook(EntityType<? extends FishingHook> type, Level world) {
|
||||
@@ -397,7 +401,7 @@ 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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user