From 933845373c865ff51b4de9ad4214982ba83c305a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=20=E9=9B=A8=E8=90=BD?= <53731501+qyl27@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:47:42 +0800 Subject: [PATCH] Fix crash cause by fake player and phantom spawner. (#331) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 秋雨落 --- patches/server/0010-Fakeplayer-support.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0010-Fakeplayer-support.patch b/patches/server/0010-Fakeplayer-support.patch index bbdec4ee..dbb42cb6 100644 --- a/patches/server/0010-Fakeplayer-support.patch +++ b/patches/server/0010-Fakeplayer-support.patch @@ -367,7 +367,7 @@ index 32910f677b0522ac8ec513fa0d00b714b52cfae4..961a7193fda00fa62acea9c39fda1c93 FeatureFlagSet featureflagset = player.level().enabledFeatures(); diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java -index 1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83..bb9d8cb957f5be517d3ae2959e0406af0d072a1c 100644 +index 1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83..aff4e1e4d2462adf00d6e984b0a0540592257056 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java @@ -67,6 +67,11 @@ public class PhantomSpawner implements CustomSpawner { @@ -376,7 +376,7 @@ index 1b1b475ca27e799e251d6f8a8c9fe1a4fd8bae83..bb9d8cb957f5be517d3ae2959e0406af boolean flag2 = true; + // Leaves start - fakeplayer spawn + if (entityplayer instanceof org.leavesmc.leaves.bot.ServerBot bot && bot.spawnPhantom) { -+ j = bot.notSleepTicks; ++ j = Math.max(bot.notSleepTicks, 1); + } + // Leaves end - fakeplayer spawn