From 0000000000000000000000000000000000000000 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


diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
index f1781c2100bf3a8fa7123b66f9ab682177d6490e..906791fc6180e011ce029ac95a63c92553f0377e 100644
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
@@ -1598,8 +1598,10 @@ public abstract class EntityLiving extends Entity {
 
         this.dropInventory(); // CraftBukkit - from below
         if (this.cW() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
+            if (!(damagesource == DamageSource.CRAMMING && world.purpurConfig.disableDropsOnCrammingDeath)) { // Purpur
             this.a(damagesource, flag);
             this.dropDeathLoot(damagesource, i, flag);
+            } // Purpur
         }
         // CraftBukkit start - Call death event
         org.bukkit.event.entity.EntityDeathEvent deathEvent = CraftEventFactory.callEntityDeathEvent(this, this.drops); // Paper
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 3a6a19bd4e952a6deb1def80755387cab75bbad8..b16ea97f4119fe2cd7c218f3fecbb7202c362665 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -112,6 +112,11 @@ public class PurpurWorldConfig {
         idleTimeoutUpdateTabList = getBoolean("gameplay-mechanics.player.idle-timeout.update-tab-list", idleTimeoutUpdateTabList);
     }
 
+    public boolean disableDropsOnCrammingDeath = false;
+    private void miscGameplayMechanicsSettings() {
+        disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
+    }
+
     public int playerSpawnInvulnerableTicks = 60;
     public boolean playerInvulnerableWhileAcceptingResourcePack = false;
     private void playerInvulnerabilities() {
