aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches
diff options
context:
space:
mode:
authorMax Lee <[email protected]>2021-05-31 01:46:42 +0100
committerGitHub <[email protected]>2021-05-31 00:46:42 +0000
commitc894e8bbbebc2100bc3e486697cc4d7310226d66 (patch)
tree3f2f3a56cee06154faab3677d44d236aae07797a /Spigot-Server-Patches
parent302e5101a626bac146e30415fde1bb5ec62310cf (diff)
downloadPaper-c894e8bbbebc2100bc3e486697cc4d7310226d66.tar.gz
Paper-c894e8bbbebc2100bc3e486697cc4d7310226d66.zip
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.
Diffstat (limited to 'Spigot-Server-Patches')
-rw-r--r--Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch9
1 files changed, 6 insertions, 3 deletions
diff --git a/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch b/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch
index edb9677fb5..0c901ddac3 100644
--- a/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch
+++ b/Spigot-Server-Patches/0015-Add-configurable-despawn-distances-for-living-entiti.patch
@@ -30,10 +30,10 @@ index b41e7922dd96c3358eb849ab39982a75736e3476..2f0d582baf0eb2bb477944d0cb1369db
+ }
}
diff --git a/src/main/java/net/minecraft/world/entity/EntityInsentient.java b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
-index 28aa0a9361e8a32763d7fe1af060f0016e8c1e50..f93af56f68d5fd27eca38d333ca429ce22fc397b 100644
+index 28aa0a9361e8a32763d7fe1af060f0016e8c1e50..6e30fc88fa7a3ff00c9b4b78842c3a533649bd50 100644
--- a/src/main/java/net/minecraft/world/entity/EntityInsentient.java
+++ b/src/main/java/net/minecraft/world/entity/EntityInsentient.java
-@@ -763,14 +763,14 @@ public abstract class EntityInsentient extends EntityLiving {
+@@ -763,16 +763,16 @@ public abstract class EntityInsentient extends EntityLiving {
int i = this.getEntityType().e().f();
int j = i * i;
@@ -48,5 +48,8 @@ index 28aa0a9361e8a32763d7fe1af060f0016e8c1e50..f93af56f68d5fd27eca38d333ca429ce
- 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;
+ }
+ }