mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Make ExperienceOrb entities call EntitySpawnEvent (#9197)
This commit is contained in:
parent
2f8d9db58c
commit
46a36d3b28
1 changed files with 22 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
index 9b9a9606e5be94b394606f2306e7b7a5ed781e1d..acb38f927c2418c91adf91c7b790ea6869835537 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -693,7 +693,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;
|
Loading…
Reference in a new issue