mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 18:37:42 +01:00
Disable loot drops on death by cramming
This commit is contained in:
@@ -45,6 +45,11 @@ enable-tps-catchup
|
|||||||
* **default**: false
|
* **default**: false
|
||||||
* **description**: Enable/disable Spigot's TPS catchup (makes everything tick faster than 20 tps after lag spikes, which can cause more lag - also skews /tps reports by ruining the average with above 20 tps entries)
|
* **description**: Enable/disable Spigot's TPS catchup (makes everything tick faster than 20 tps after lag spikes, which can cause more lag - also skews /tps reports by ruining the average with above 20 tps entries)
|
||||||
|
|
||||||
|
disable-drops-on-cramming-death
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
* **default**: true
|
||||||
|
* **description**: Stops entities from dropping loot on death, if killed by cramming gamerule
|
||||||
|
|
||||||
large-ender-chests
|
large-ender-chests
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
* **default**: true
|
* **default**: true
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
From 0a5c87d6539c256647205f6fb63450f581a139ea 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
|
||||||
|
|
||||||
Reference in New Issue
Block a user