Files
Purpur/patches/server/0121-Entities-pick-up-loot-bypass-mob-griefing-gamerule.patch
William Blake Galbreath a2db5eebbe Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly

Paper Changes:
8ce3dd5f [CI-SKIP] Fix Mojang API Brigadier dep - THIS IS NOT A NEW BUILD
00d760a5 Fix build due to spigot changing the build timestamp process
842e040c Updated Upstream (Bukkit/CraftBukkit/Spigot)
c03260a2 Add getter and setter for villager's numberOfRestocksToday (#3231)
fe366fbe null check tracker for entity metadata update - Fixes #3070
fdf41b74 Implement Brigadier Mojang API
e0ea2e0e Entity Activation Range 2.0! Major improvements to restoring behavior
10396d28 Fix Tracking Range mismatch on Vehicle/Passenger checks
2020-04-28 20:14:57 -05:00

47 lines
3.0 KiB
Diff

From ff1db34db12d20251bb1301e66d937f12856b9f7 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Fri, 24 Apr 2020 09:33:11 -0500
Subject: [PATCH] Entities pick up loot bypass mob-griefing gamerule
---
src/main/java/net/minecraft/server/EntityInsentient.java | 2 +-
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java
index eb0befb35..4e5b71046 100644
--- a/src/main/java/net/minecraft/server/EntityInsentient.java
+++ b/src/main/java/net/minecraft/server/EntityInsentient.java
@@ -525,7 +525,7 @@ public abstract class EntityInsentient extends EntityLiving {
public void movementTick() {
super.movementTick();
this.world.getMethodProfiler().enter("looting");
- if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) {
+ if (!this.world.isClientSide && this.canPickupLoot() && this.isAlive() && !this.killed && (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || world.purpurConfig.entitiesPickUpLootBypassMobGriefing)) {
List<EntityItem> list = this.world.a(EntityItem.class, this.getBoundingBox().grow(1.0D, 0.0D, 1.0D));
Iterator iterator = list.iterator();
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index fa92f92b2..394c62f49 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -209,6 +209,7 @@ public class PurpurWorldConfig {
public double controllableMinecartsBaseSpeed = 0.1D;
public Map<Block, Double> controllableMinecartsBlockSpeeds = new HashMap<>();
public boolean disableDropsOnCrammingDeath = false;
+ public boolean entitiesPickUpLootBypassMobGriefing = false;
public boolean fixClimbingBypassingCrammingRule = false;
public boolean itemFloatInLava = false;
public List<Item> itemImmuneToExplosion = new ArrayList<>();
@@ -244,6 +245,7 @@ public class PurpurWorldConfig {
set("gameplay-mechanics.controllable-minecarts.block-speed.stone", 0.5D);
}
disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath);
+ entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing);
fixClimbingBypassingCrammingRule = getBoolean("gameplay-mechanics.fix-climbing-bypassing-cramming-rule", fixClimbingBypassingCrammingRule);
itemFloatInLava = getBoolean("gameplay-mechanics.item.float-in-lava", itemFloatInLava);
getList("gameplay-mechanics.item.immune.explosion", itemImmuneToExplosion).forEach(key -> {
--
2.24.0