Files
Purpur/patches/server/0136-Add-config-for-allowing-Endermen-to-despawn-even-whi.patch
jmp 7f4c8f8715 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
7232d8f2a EntityLoadCrossbowEvent#shouldConsumeItem
4740bd6c8 Mark PlayerInventory#getItem as nullable
bd9ace578 Add a config option to limit the number of entities of each type to load/save in a chunk (#4792)
6bafeb5a9 Move logic from last patch into correct place
9668118fd disable entity ticking flag after watchdog obliteration
2021-01-14 14:47:12 -08:00

40 lines
2.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.com>
Date: Sun, 22 Nov 2020 22:17:53 -0800
Subject: [PATCH] Add config for allowing Endermen to despawn even while
holding a block
This should help to reduce the amount of dirt, gravel, grass, and etc.
that Endermen like to randomly place all over the world.
diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java
index 995849212c25568d3aa28ada78babf8b8e669960..acb2b3ed04ea0bf19335415310ce22cd076dd92a 100644
--- a/src/main/java/net/minecraft/server/EntityEnderman.java
+++ b/src/main/java/net/minecraft/server/EntityEnderman.java
@@ -372,7 +372,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
@Override
public boolean isSpecialPersistence() {
- return super.isSpecialPersistence() || this.getCarried() != null;
+ return super.isSpecialPersistence() || (!this.world.purpurConfig.endermanDespawnEvenWithBlock && this.getCarried() != null); // Purpur
}
static class PathfinderGoalEndermanPickupBlock extends PathfinderGoal {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 91ba7f0b3ddb2846119e4b74ba501f6b40938702..5df5f771dfcdd01386600531defa4ab1b612160b 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -572,10 +572,12 @@ public class PurpurWorldConfig {
public boolean endermanRidable = false;
public boolean endermanRidableInWater = false;
public boolean endermanAllowGriefing = true;
+ public boolean endermanDespawnEvenWithBlock = false;
private void endermanSettings() {
endermanRidable = getBoolean("mobs.enderman.ridable", endermanRidable);
endermanRidableInWater = getBoolean("mobs.enderman.ridable-in-water", endermanRidableInWater);
endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
+ endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
}
public boolean endermiteRidable = false;