Skip to content

Commit

Permalink
Fix crash cause by fake player and phantom spawner. (LeavesMC#331)
Browse files Browse the repository at this point in the history
Signed-off-by: 秋雨落 <i@rain.cx>
  • Loading branch information
qyl27 authored and Lumine1909 committed Sep 15, 2024
1 parent d923cc6 commit 7b41d83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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

Expand Down

0 comments on commit 7b41d83

Please sign in to comment.