9
0
mirror of https://github.com/LeavesMC/Leaves.git synced 2026-01-04 15:41:31 +00:00

Despawn enderman with block

This commit is contained in:
violetc
2023-06-17 15:21:04 +08:00
parent b2b36fac6a
commit 376780651a
2 changed files with 26 additions and 2 deletions

View File

@@ -128,10 +128,10 @@ index 5c4bf6d99da409988871465de27e0357af79f37e..ce9873f216cbb330dee4abbdf8b0459f
.withRequiredArg()
diff --git a/src/main/java/top/leavesmc/leaves/LeavesConfig.java b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..325c4068bfddc28dd3b04e60cba1d27fc0302b8a
index 0000000000000000000000000000000000000000..3572c769f9b5bf66b99d1d6f85312396c27b0fba
--- /dev/null
+++ b/src/main/java/top/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,733 @@
@@ -0,0 +1,738 @@
+package top.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
@@ -690,6 +690,11 @@ index 0000000000000000000000000000000000000000..325c4068bfddc28dd3b04e60cba1d27f
+ disableCheckOutOfOrderCommand = getBoolean("settings.modify.disable-check-out-of-order-command", disableCheckOutOfOrderCommand);
+ }
+
+ public static boolean despawnEndermanWithBlock = false;
+ private static void despawnEndermanWithBlock() {
+ despawnEndermanWithBlock = getBoolean("settings.modify.despawn-enderman-with-block", despawnEndermanWithBlock);
+ }
+
+ public static final class WorldConfig {
+
+ public final String worldName;

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: violetc <58360096+s-yh-china@users.noreply.github.com>
Date: Sat, 17 Jun 2023 15:20:28 +0800
Subject: [PATCH] Despawn enderman with block
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 b88fad64de2e4af5f0199632ae7f0a06f8288824..4bf256108047b7ade219d6aa60b0adc5f1272afc 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -475,7 +475,7 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean requiresCustomPersistence() {
- return super.requiresCustomPersistence() || this.getCarriedBlock() != null;
+ return super.requiresCustomPersistence() || (top.leavesmc.leaves.LeavesConfig.despawnEndermanWithBlock && this.getCarriedBlock() != null);
}
private static class EndermanFreezeWhenLookedAt extends Goal {