mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 04:32:11 -07: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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user