Skip to content

Commit

Permalink
Try to fix #291, #292 (#293)
Browse files Browse the repository at this point in the history
* Try to fix #291, #292
  • Loading branch information
Lumine1909 authored Aug 4, 2024
1 parent a7b7a1a commit cd53d4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1931,7 +1932,7 @@ index 0000000000000000000000000000000000000000..f04bd729fbabbf51c432d3d8eb39f059
+
+ public Entity getTargetEntity(int maxDistance, Predicate<? super Entity> predicate) {
+ List<Entity> 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);
Expand Down

0 comments on commit cd53d4c

Please sign in to comment.