2023-07-22 22:19:50 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Golfing8 <atroo@me.com>
|
|
|
|
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
|
2023-09-22 19:31:02 +02:00
|
|
|
index 7e21999652796ae90f8c4b0747ecef2fd90c480a..7f6e5c65306b3984804b7dd2751b34584f13a8f5 100644
|
2023-07-22 22:19:50 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
2023-09-22 18:59:52 +02:00
|
|
|
@@ -720,7 +720,10 @@ public class CraftEventFactory {
|
2023-07-22 22:19:50 +02:00
|
|
|
} 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;
|