Several fixes and new api for experience merging/stacking (#9242)
This commit is contained in:
parent
ed85aac53c
commit
a31dc90741
693 changed files with 318 additions and 240 deletions
|
@ -0,0 +1,20 @@
|
|||
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 67604683e474701ac84b6e0a2f9c93a50978147b..332fb71629dfb281656e6473fb5504557848aab5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -735,7 +735,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;
|
Loading…
Add table
Add a link
Reference in a new issue