Skip to content

Commit

Permalink
Try to fix #291, #292
Browse files Browse the repository at this point in the history
  • Loading branch information
Lumine1909 committed Aug 4, 2024
1 parent a7b7a1a commit 22f392c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions patches/server/0006-Leaves-Server-Config-And-Command.patch
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ index c2c421b1caf76b40542fdc436801accbe97a38cb..29f139fb4d70a9a362ac0a30579eb0b4
.withRequiredArg()
diff --git a/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d616c2547a6
index 0000000000000000000000000000000000000000..9d0f2aeaeadfc5f8ea0663bc7fb950894754c103
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/LeavesConfig.java
@@ -0,0 +1,939 @@
@@ -0,0 +1,942 @@
+package org.leavesmc.leaves;
+
+import com.destroystokyo.paper.util.SneakyThrow;
Expand Down Expand Up @@ -244,6 +244,9 @@ index 0000000000000000000000000000000000000000..5009708d8875f2a88e76f4a48c180d61
+ @GlobalConfig(name = "modify-config", category = {"modify", "fakeplayer"})
+ public static boolean fakeplayerModifyConfig = false;
+
+ @GlobalConfig(name = "drop-on-remove", category = {"modify", "fakeplayer"})
+ public static boolean fakeplayerDropOnRemove = true;
+
+ // Leaves end - modify - fakeplayer
+
+ // Leaves start - modify - minecraft-old
Expand Down
9 changes: 6 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..828ee4161304fde46a219dca9b9ab03d0c88f7cb
--- /dev/null
+++ b/src/main/java/org/leavesmc/leaves/bot/ServerBot.java
@@ -0,0 +1,766 @@
@@ -0,0 +1,769 @@
+package org.leavesmc.leaves.bot;
+
+import com.google.common.collect.Lists;
Expand Down Expand Up @@ -1788,6 +1788,9 @@ index 0000000000000000000000000000000000000000..f04bd729fbabbf51c432d3d8eb39f059
+ if (!new BotRemoveEvent(this.getBukkitPlayer(), reason, remover).callEvent()) {
+ return;
+ }
+ if (LeavesConfig.fakeplayerDropOnRemove) {
+ dropAll();
+ }
+ if (this.removeTaskId != -1) {
+ Bukkit.getScheduler().cancelTask(this.removeTaskId);
+ this.removeTaskId = -1;
Expand Down Expand Up @@ -1931,7 +1934,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 22f392c

Please sign in to comment.