aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch')
-rw-r--r--patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch b/patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch
new file mode 100644
index 0000000000..24e77389a5
--- /dev/null
+++ b/patches/server/0973-ExperienceOrb-should-call-EntitySpawnEvent.patch
@@ -0,0 +1,22 @@
+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 f08abdff3e190391d2b65e32e45eb391aeb4f346..def4d88b227b8764a84392843a2f0a026f9ee3fc 100644
+--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
++++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+@@ -720,7 +720,10 @@ public class CraftEventFactory {
+ } else if (entity instanceof net.minecraft.world.entity.ExperienceOrb) {
+ net.minecraft.world.entity.ExperienceOrb xp = (net.minecraft.world.entity.ExperienceOrb) entity;
+ double radius = world.spigotConfig.expMerge;
+- if (radius > 0) {
++ // Paper start - Call EntitySpawnEvent for ExperienceOrb entities.
++ event = CraftEventFactory.callEntitySpawnEvent(entity);
++ if (radius > 0 && !event.isCancelled() && !entity.isRemoved()) {
++ // Paper end
+ // Paper start - Maximum exp value when merging - Whole section has been tweaked, see comments for specifics
+ final int maxValue = world.paperConfig().entities.behavior.experienceMergeMaxValue;
+ final boolean mergeUnconditionally = world.paperConfig().entities.behavior.experienceMergeMaxValue <= 0;