Files
Purpur/patches/server/0037-Disable-loot-drops-on-death-by-cramming.patch
William Blake Galbreath 378bbf478c Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
8812fed9 Merge pull request #2240 from Spottedleaf/anti-xray
bd46b639 Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray
e679a7c1 Config migrations
0a667728 Resolve crash issue by shoving chunk loads onto the next tick
3a2d7f2d Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray
5ffa0dae Do not force load chunks for plugin constructed packets
e993aa6f Merge branch 'ver/1.14' of github.com:PaperMC/Paper into anti-xray
9a4a185f Keep neighbour chunks loaded while obfuscating
f1f8060a Fix build?
76eb2a5e Use getChunkIfLoadedImmediately not getChunkIfCachedImmediately
ad757f96 Delete 0335-Anti-Xray.patch
46a6f1b2 Re-Add Anti-Xray
2019-07-09 21:26:17 -05:00

45 lines
2.3 KiB
Diff

From 506787fba7dcb7fa1f77a9492d8649df5f7f9f50 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Wed, 3 Jul 2019 23:58:31 -0500
Subject: [PATCH] Disable loot drops on death by cramming
---
src/main/java/net/minecraft/server/EntityLiving.java | 2 ++
src/main/java/net/pl3x/purpur/PurpurConfig.java | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 1704609a7..54b81110b 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1420,8 +1420,10 @@ public abstract class EntityLiving extends Entity {
org.bukkit.event.entity.EntityDeathEvent deathEvent = null; // Paper
if (this.isDropExperience() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
+ if (!(damagesource == DamageSource.CRAMMING && net.pl3x.purpur.PurpurConfig.disableDropsOnCrammingDeath)) { // Purpur - do not drop loot if crammed to death
this.a(damagesource, flag);
this.dropDeathLoot(damagesource, i, flag);
+ } // Purpur - do not drop loot if crammed to death
// CraftBukkit start - Call death event
deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
if (!deathEvent.isCancelled()) this.drops = new ArrayList<org.bukkit.inventory.ItemStack>(); // Paper
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
index 0d378830e..a6f90105f 100644
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
@@ -136,6 +136,11 @@ public class PurpurConfig {
enableTPSCatchup = getBoolean("settings.enable-tps-catchup", enableTPSCatchup);
}
+ public static boolean disableDropsOnCrammingDeath = true;
+ private static void disableDropsOnCrammingDeath() {
+ disableDropsOnCrammingDeath = getBoolean("settings.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
+ }
+
public static boolean requireShiftToMount = true;
private static void requireShiftToMount() {
requireShiftToMount = getBoolean("settings.mobs.require-shift-to-mount", requireShiftToMount);
--
2.20.1