aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0031-Add-configurable-entity-despawn-distances.patch
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2024-07-17 10:24:53 -0700
committerSpottedleaf <[email protected]>2024-07-17 10:28:32 -0700
commit00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6 (patch)
tree82639515bc5e9ae00c1e639e72137ed51e1ac688 /patches/server/0031-Add-configurable-entity-despawn-distances.patch
parent967f98aa81da851740aeb429778e46159fd188df (diff)
downloadPaper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.tar.gz
Paper-00b949f1bbbf444e2b5e7b8de7c9b14fbd2133c6.zip
Remove Moonrise utils to MCUtils, remove duplicated/unused utils
Diffstat (limited to 'patches/server/0031-Add-configurable-entity-despawn-distances.patch')
-rw-r--r--patches/server/0031-Add-configurable-entity-despawn-distances.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0031-Add-configurable-entity-despawn-distances.patch b/patches/server/0031-Add-configurable-entity-despawn-distances.patch
new file mode 100644
index 0000000000..348a1c4e40
--- /dev/null
+++ b/patches/server/0031-Add-configurable-entity-despawn-distances.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Suddenly <[email protected]>
+Date: Tue, 1 Mar 2016 13:51:54 -0600
+Subject: [PATCH] Add configurable entity despawn distances
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
+index bf905bc1c4918412e3c324a62d2915b57c40d2cc..51b33ea29af0f4010dfb8a1a7503cb7ca463209e 100644
+--- a/src/main/java/net/minecraft/world/entity/Mob.java
++++ b/src/main/java/net/minecraft/world/entity/Mob.java
+@@ -866,14 +866,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+
+ if (entityhuman != null) {
+ double d0 = entityhuman.distanceToSqr((Entity) this);
+- int i = this.getType().getCategory().getDespawnDistance();
++ int i = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).hard(); // Paper - Configurable despawn distances
+ int j = i * i;
+
+ if (d0 > (double) j && this.removeWhenFarAway(d0)) {
+ this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
+ }
+
+- int k = this.getType().getCategory().getNoDespawnDistance();
++ int k = this.level().paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - Configurable despawn distances
+ int l = k * k;
+
+ if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {