2018-07-23 10:39:55 +02:00
|
|
|
From 2c317cc196671b1892fe0fdf7b50105a322978e9 Mon Sep 17 00:00:00 2001
|
2017-12-20 04:57:46 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 19 Dec 2017 22:57:26 -0500
|
|
|
|
Subject: [PATCH] ExperienceOrbMergeEvent
|
|
|
|
|
|
|
|
Fired when the server is about to merge 2 experience orbs
|
|
|
|
Plugins can cancel this if they want to ensure experience orbs do not lose important
|
|
|
|
metadata such as spawn reason, or conditionally move data from source to target.
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2018-07-23 10:39:55 +02:00
|
|
|
index 642a504d4f..00eb342f8c 100644
|
2017-12-20 04:57:46 +01:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2018-07-19 06:42:43 +02:00
|
|
|
@@ -1003,7 +1003,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
|
2017-12-20 04:57:46 +01:00
|
|
|
for (Entity e : entities) {
|
|
|
|
if (e instanceof EntityExperienceOrb) {
|
|
|
|
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;
|
|
|
|
- if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) { // Paper
|
|
|
|
+ if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue) && new com.destroystokyo.paper.event.entity.ExperienceOrbMergeEvent((org.bukkit.entity.ExperienceOrb) entity.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) loopItem.getBukkitEntity()).callEvent()) { // Paper
|
|
|
|
xp.value += loopItem.value;
|
|
|
|
// Paper start
|
|
|
|
if (!mergeUnconditionally && xp.value > maxValue) {
|
|
|
|
--
|
2018-06-30 07:40:52 +02:00
|
|
|
2.18.0
|
2017-12-20 04:57:46 +01:00
|
|
|
|