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
|
2024-04-30 00:16:07 +02:00
|
|
|
index 3679bc4573346666088995903a3418c359444532..d3b85371b014e462b3bd53ec179214c17640ef72 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
|
2024-04-25 00:36:49 +02:00
|
|
|
@@ -735,7 +735,8 @@ public class CraftEventFactory {
|
2023-12-06 17:34:54 +01:00
|
|
|
// 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) {
|
2023-07-22 22:19:50 +02:00
|
|
|
double radius = world.spigotConfig.expMerge;
|
|
|
|
- if (radius > 0) {
|
2024-01-21 12:11:43 +01:00
|
|
|
+ event = CraftEventFactory.callEntitySpawnEvent(entity); // Call spawn event for ExperienceOrb entities
|
2023-07-22 22:19:50 +02:00
|
|
|
+ if (radius > 0 && !event.isCancelled() && !entity.isRemoved()) {
|
2024-01-21 12:11:43 +01:00
|
|
|
// Paper start - Maximum exp value when merging; Whole section has been tweaked, see comments for specifics
|
2023-07-22 22:19:50 +02:00
|
|
|
final int maxValue = world.paperConfig().entities.behavior.experienceMergeMaxValue;
|
|
|
|
final boolean mergeUnconditionally = world.paperConfig().entities.behavior.experienceMergeMaxValue <= 0;
|