mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
060bc7bbee
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 4543fb40 SPIGOT-4943: Zombie villager conversion player API. CraftBukkit Changes:585b2ebd
Tweak thresholds for can't keep up message91ada5c2
SPIGOT-4956: EntityTameEvent not triggered when taming a Cat9bda4134
SPIGOT-4943: Zombie villager conversion player API.5a027071
SPIGOT-4947: Allow setting the content on a lectern09d00e9f
SPIGOT-4938: Call EntityPickupItemEvent for dolphinsa278e445
SPIGOT-4948: Lectern.getInventory should return a LecternInventory Spigot Changes: 4f661b22 Rebuild patches
26 lines
1.6 KiB
Diff
26 lines
1.6 KiB
Diff
From 19d8f5f5e055a592c2e9f77df9aa519667028d4a Mon Sep 17 00:00:00 2001
|
|
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/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
index 46531ffbe..4e84f4373 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -525,7 +525,7 @@ public class CraftEventFactory {
|
|
if (e instanceof EntityExperienceOrb) {
|
|
EntityExperienceOrb loopItem = (EntityExperienceOrb) e;
|
|
// Paper start
|
|
- if (!loopItem.dead && !(maxValue > 0 && loopItem.value >= maxValue)) {
|
|
+ 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
|
|
long newTotal = (long)xp.value + (long)loopItem.value;
|
|
if ((int) newTotal < 0) continue; // Overflow
|
|
if (maxValue > 0 && newTotal > (long)maxValue) {
|
|
--
|
|
2.21.0
|
|
|