aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch')
-rw-r--r--patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch
new file mode 100644
index 0000000000..e3ebc75918
--- /dev/null
+++ b/patches/server/0846-ExperienceOrb-should-call-EntitySpawnEvent.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Golfing8 <[email protected]>
+Date: Mon, 8 May 2023 09:18:17 -0400
+Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+index cbb5baae60e682bc250568327737a1b1994ceb76..01f6d9a3339529bc3a1ec2bacae422b86f1eb253 100644
+--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+@@ -737,7 +737,8 @@ public class CraftEventFactory {
+ // Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above)
+ if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) {
+ double radius = world.spigotConfig.expMerge;
+- if (radius > 0) {
++ event = CraftEventFactory.callEntitySpawnEvent(entity); // Call spawn event for ExperienceOrb entities
++ if (radius > 0 && !event.isCancelled() && !entity.isRemoved()) {
+ // Paper start - Maximum exp value when merging; Whole section has been tweaked, see comments for specifics
+ final long maxValue = world.paperConfig().entities.behavior.experienceMergeMaxValue;
+ final boolean mergeUnconditionally = maxValue <= 0;