Files
Purpur/patches/server/0051-Disable-loot-drops-on-death-by-cramming.patch
BillyGalbreath 4e8a150377 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
98a702c7d [CI-SKIP] [Auto] Rebuild Patches
cab361600 Expose LivingEntity hurt direction
7ef05fbd8 Do not perform neighbour updates when using debug stick (Fixes #2134)
2020-12-23 00:45:57 -06:00

38 lines
2.1 KiB
Diff

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/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index b9af6b392d4c7e83263d763eb86e77a407ca5ebf..9373b7123eb4f108a96638c3814d50a47426a049 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1490,8 +1490,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 7bb80ab8fde39f39a0834e4ed2d3002e73885737..dde6877f175d6a80d86f78ce25aa4626cdd6bbe5 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() {