From cd53d4c9a5e3df9626a570c528b5244207958a94 Mon Sep 17 00:00:00 2001 From: Lumine1909 <133463833+Lumine1909@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:35:40 -0400 Subject: [PATCH] Try to fix #291, #292 (#293) * Try to fix #291, #292 --- patches/server/0010-Fakeplayer-support.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/patches/server/0010-Fakeplayer-support.patch b/patches/server/0010-Fakeplayer-support.patch index 848daa7a..c3a75cb1 100644 --- a/patches/server/0010-Fakeplayer-support.patch +++ b/patches/server/0010-Fakeplayer-support.patch @@ -1510,10 +1510,10 @@ index 0000000000000000000000000000000000000000..0db337866c71283464d026a4f230016b +} diff --git a/src/main/java/org/leavesmc/leaves/bot/ServerBot.java b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java new file mode 100644 -index 0000000000000000000000000000000000000000..f04bd729fbabbf51c432d3d8eb39f059740fd157 +index 0000000000000000000000000000000000000000..1314bcb0dfa311d671fcdcfeee4a8394b69834ad --- /dev/null +++ b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java -@@ -0,0 +1,766 @@ +@@ -0,0 +1,767 @@ +package org.leavesmc.leaves.bot; + +import com.google.common.collect.Lists; @@ -1788,6 +1788,7 @@ index 0000000000000000000000000000000000000000..f04bd729fbabbf51c432d3d8eb39f059 + if (!new BotRemoveEvent(this.getBukkitPlayer(), reason, remover).callEvent()) { + return; + } ++ dropAll(); + if (this.removeTaskId != -1) { + Bukkit.getScheduler().cancelTask(this.removeTaskId); + this.removeTaskId = -1; @@ -1931,7 +1932,7 @@ index 0000000000000000000000000000000000000000..f04bd729fbabbf51c432d3d8eb39f059 + + public Entity getTargetEntity(int maxDistance, Predicate predicate) { + List entities = this.level().getEntities((Entity) null, this.getBoundingBox(), (e -> e != this && (predicate == null || predicate.test(e)))); -+ if (entities.isEmpty()) { ++ if (!entities.isEmpty()) { + return entities.getFirst(); + } else { + EntityHitResult result = this.getBukkitEntity().rayTraceEntity(3, false);