aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0798-Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch
blob: 17215f32f274139a61e061d23e61ca5fd9f8fa94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Fri, 20 Aug 2021 18:36:02 -0700
Subject: [PATCH] Dont count named piglins and hoglins towards mob cap


diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 49a0ceaf9a08f64f84f3925cfba3fab6bb034bae..3ce14f26abb890e0d3fbf9b02747c4614ec46b47 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -83,7 +83,7 @@ public final class NaturalSpawner {
                 Mob entityinsentient = (Mob) entity;
 
                 // CraftBukkit - Split out persistent check, don't apply it to special persistent mobs
-                if (entityinsentient.removeWhenFarAway(0) && entityinsentient.isPersistenceRequired()) {
+                if ((entityinsentient instanceof net.minecraft.world.entity.monster.piglin.Piglin || entityinsentient instanceof net.minecraft.world.entity.monster.hoglin.Hoglin || entityinsentient.removeWhenFarAway(0)) && entityinsentient.isPersistenceRequired()) { // Paper - what a jank fix, CBs like totally tried to change what removeWhenFarAway does, that method isnt even called here in vanilla, idk wtf is going on
                     continue;
                 }
             }