Paper/patches/server/0329-PlayerDeathEvent-shouldDropExperience.patch
2023-09-24 12:35:16 +10: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 0e59ea13f1fd3abf684133b0e7f3df00c93b2061..dcb6a1bd3774e63dd14fbd8ddd6ff09c68741379 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -970,7 +970,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