From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Suddenly 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 b86ad4fbf1245c4c040d84daf9f93bd1aee6beae..1de4c45f1a3a69e63eccf063be5516b163f7882a 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -853,14 +853,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 - Configurable 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 - Configurable despawn distances int l = k * k; if (this.noActionTime > 600 && this.random.nextInt(800) == 0 && d0 > (double) l && this.removeWhenFarAway(d0)) {