mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 03:50:36 +01:00
Fix issue with soft despawn distance (#5755)
Previously setting the soft despawn distance above the default value of 32 would mean that an entity outside of the 32 range would still count ticksFarFromPlayer up every tick without resetting it which might lead to the entity (almost) instantly despawning once it went outside of the configured distance instead of waiting 600 ticks.
This commit is contained in:
parent
69cbc63e05
commit
80852eb3b2
1 changed files with 4 additions and 1 deletions
|
@ -48,5 +48,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- if (this.ticksFarFromPlayer > 600 && this.random.nextInt(800) == 0 && d0 > (double) l) { // CraftBukkit - remove isTypeNotPersistent() check
|
||||
+ if (this.ticksFarFromPlayer > 600 && this.random.nextInt(800) == 0 && d0 > world.paperConfig.softDespawnDistance) { // CraftBukkit - remove isTypeNotPersistent() check // Paper - custom despawn distances
|
||||
this.die();
|
||||
} else if (d0 < (double) l) {
|
||||
- } else if (d0 < (double) l) {
|
||||
+ } else if (d0 < world.paperConfig.softDespawnDistance) { // Paper - custom despawn distances
|
||||
this.ticksFarFromPlayer = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue