Paper/patches/server/0340-PlayerDeathEvent-shouldDropExperience.patch
Nassim Jahnke 345a6a6205
Updated Upstream (CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
ef0946409 PR-1091: Fix exit position in entity travel with portals
d12768f75 PR-1090: Remove no longer needed world reference from CraftMerchantCustom
7550f6854 SPIGOT-7115: Support hex color codes in custom merchant inventory titles
2022-07-25 18:44:24 +02:00

20 lines
1.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Tue, 24 Dec 2019 00:35:42 +0000
Subject: [PATCH] PlayerDeathEvent#shouldDropExperience
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index aafe0fb730235be7c77b5539fbafbe8babba462c..3ba550d0de4b88379331cf56fe114f7c7e0ea558 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -897,7 +897,7 @@ public class ServerPlayer extends Player {
this.tellNeutralMobsThatIDied();
}
// SPIGOT-5478 must be called manually now
- this.dropExperience();
+ if (event.shouldDropExperience()) this.dropExperience(); // Paper - tie to event
// we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
if (!event.getKeepInventory()) {
// Paper start - replace logic