Fix logic bug in negative XP bug fix - Closes #1169

This commit is contained in:
Aikar
2018-08-03 20:59:35 -04:00
parent 6116576bf3
commit a75c747cd7
6 changed files with 11 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
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
index c0e79796bd..986670f689 100644
index 60bfe2608d..e361883099 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
@@ -18,6 +18,6 @@ index c0e79796bd..986670f689 100644
- 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()) {
long newTotal = (long)xp.value + (long)loopItem.value;
if (newTotal > (long)maxValue) {
loopItem.value = xp.value - maxValue;
if ((int) newTotal < 0) continue; // Overflow
if (maxValue > 0 && newTotal > (long)maxValue) {
--