1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-31 03:50:36 +01:00

Fix issue with soft despawn distance ()

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:
Max Lee 2021-05-31 01:46:42 +01:00
parent 69cbc63e05
commit 80852eb3b2

View file

@ -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;
}
}