mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
43 lines
2.5 KiB
Diff
43 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.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/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
index 1a33a41f79f9d661cb958a6ecee2ab7e8a819877..3a37ff8bd8ca792393fa10fed4d38eb72559d4db 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
@@ -468,7 +468,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
|
|
@Override
|
|
public boolean requiresCustomPersistence() {
|
|
- return super.requiresCustomPersistence() || this.getCarriedBlock() != null;
|
|
+ return super.requiresCustomPersistence() || (!this.level().purpurConfig.endermanDespawnEvenWithBlock && this.getCarriedBlock() != null); // Purpur
|
|
}
|
|
|
|
private static class EndermanFreezeWhenLookedAt extends Goal {
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index 258f973c9debcaf09f95f73b8ca1276e107d29f8..bc28a4851dd68874042c05bed3486eace3db5963 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -847,6 +847,7 @@ public class PurpurWorldConfig {
|
|
public double endermanMaxHealth = 40.0D;
|
|
public double endermanScale = 1.0D;
|
|
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);
|
|
@@ -859,6 +860,7 @@ public class PurpurWorldConfig {
|
|
endermanMaxHealth = getDouble("mobs.enderman.attributes.max_health", endermanMaxHealth);
|
|
endermanScale = Mth.clamp(getDouble("mobs.enderman.attributes.scale", endermanScale), 0.0625D, 16.0D);
|
|
endermanAllowGriefing = getBoolean("mobs.enderman.allow-griefing", endermanAllowGriefing);
|
|
+ endermanDespawnEvenWithBlock = getBoolean("mobs.enderman.can-despawn-with-held-block", endermanDespawnEvenWithBlock);
|
|
}
|
|
|
|
public boolean endermiteRidable = false;
|