Yatopia/patches/Purpur/patches/server/0047-Disable-loot-drops-on-...

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 46b1bc644c0584fe7006ea9f111d7f4837299dc9..1dddf80e11db54a666de8c3b0d7a5c8a5f1f93ab 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1501,8 +1501,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 c6682064ff5d653d14f658396a6a5461d4554fab..8d1ad37f17935331ee867c15f91842cdc53d4450 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() {