summaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0024-Add-configurable-despawn-distances-for-living-entiti.patch
blob: 6eebfac0dea21c34edcdf2c446fe07d534d510eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Suddenly <suddenly@suddenly.coffee>
Date: Tue, 1 Mar 2016 13:51:54 -0600
Subject: [PATCH] Add configurable despawn distances for living entities


diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 8dea6df3456fd37095400711c94b0d0866988745..f74e1788692c3f9b291e6ba5043944a3179b97e1 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -841,14 +841,14 @@ public abstract class Mob extends LivingEntity implements Targeting {
 
             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 - custom despawn distances
                 int j = i * i;
 
                 if (d0 > (double) j && this.removeWhenFarAway(d0)) {
                     this.discard();
                 }
 
-                int k = this.getType().getCategory().getNoDespawnDistance();
+                int k = this.level.paperConfig().entities.spawning.despawnRanges.get(this.getType().getCategory()).soft(); // Paper - custom despawn distances
                 int l = k * k;
 
                 if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {