mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
301ca13c71
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: 3aa8286b SPIGOT-794: Add boats to EntityPlaceEvent c36d90a6 SPIGOT-5464: Add BEEHIVE SpawnReason for when a bee leaves a beehive CraftBukkit Changes:90ef74ef
SPIGOT-794: Add boats to EntityPlaceEventfb7abcb3
SPIGOT-5466: Bees still get angry even if damage event cancelled4499fec5
SPIGOT-5464: Add BEEHIVE SpawnReason for when a bee leaves a beehive
23 lines
No EOL
1.6 KiB
Diff
23 lines
No EOL
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 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 b8e5c6322..060671a58 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
|
@@ -0,0 +0,0 @@ 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) {
|
|
--
|