Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable bot death event #252

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,22 @@ index 2cde808bfa797256409879505ba205a71f381981..a007beca6c00bce4514889935b1762a3
// Special case complex part, since there is no extra entity type for them
if (entity instanceof EnderDragonPart complexPart) {
if (complexPart.parentMob instanceof EnderDragon) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 9c7cd9387f90d061aec76f7f0451a1da8b42ea3d..7c6de0ad3b919043b95429a4e506d63d32543598 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1018,7 +1018,10 @@ public class CraftEventFactory {
event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
populateFields(victim, event); // Paper - make cancellable
- Bukkit.getServer().getPluginManager().callEvent(event);
+ // Leaves start - disable bot death event
+ if (!(victim instanceof org.leavesmc.leaves.bot.ServerBot)) {
+ Bukkit.getServer().getPluginManager().callEvent(event);
+ } // Leaves end
// Paper start - make cancellable
if (event.isCancelled()) {
return event;
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index bb9383f1a457433f9db3e78d7913616280925200..55b41ca7630db143d70137324a9de8717397f0e8 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
Expand Down