diff --git a/patches/server/0006-Leaves-Server-Config-And-Command.patch b/patches/server/0006-Leaves-Server-Config-And-Command.patch index e1250e9d..0d6eb9c9 100644 --- a/patches/server/0006-Leaves-Server-Config-And-Command.patch +++ b/patches/server/0006-Leaves-Server-Config-And-Command.patch @@ -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; @@ -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 diff --git a/patches/server/0010-Fakeplayer-support.patch b/patches/server/0010-Fakeplayer-support.patch index 848daa7a..cfe77c92 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..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; @@ -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; @@ -1931,7 +1934,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);