Paper/patches/server/0682-Add-a-bunch-of-missing-forceDrop-toggles.patch

49 Zeilen
2.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 20 Jul 2021 21:25:35 -0700
Subject: [PATCH] Add a bunch of missing forceDrop toggles
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
2021-11-25 00:46:26 +01:00
index e47f3092b6bd6b86b577de705db1a575d0952348..490212cfe4e5cea7219eaf4304e14bfac0e6472d 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
@@ -100,7 +100,9 @@ public class WorkAtComposter extends WorkAtPoi {
ItemStack itemstack = inventorysubcontainer.addItem(new ItemStack(Items.BREAD, j));
if (!itemstack.isEmpty()) {
+ entity.forceDrops = true; // Paper
entity.spawnAtLocation(itemstack, 0.5F);
+ entity.forceDrops = false; // Paper
}
}
diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java
2022-06-08 11:31:06 +02:00
index 9c07e3f5554b3b9cf2a2c4d9239a72342567d7f1..39c26f486d6392eb0a9b623cdb2161846357174b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
2021-11-25 00:46:26 +01:00
@@ -522,7 +522,9 @@ public class Panda extends Animal {
}
if (!this.level.isClientSide() && this.random.nextInt(700) == 0 && this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
+ this.forceDrops = true; // Paper
this.spawnAtLocation((ItemLike) Items.SLIME_BALL);
+ this.forceDrops = false; // Paper
}
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
2022-06-08 11:31:06 +02:00
index d733bcf1049a21009c2548679a51563c15f79523..793576928dad6752dddd86e62d4c0800d8515fc4 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
2022-06-08 11:31:06 +02:00
@@ -306,7 +306,9 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
protected void finishConversion(ServerLevel world) {
PiglinAi.cancelAdmiring(this);
+ this.forceDrops = true; // Paper
this.inventory.removeAllItems().forEach(this::spawnAtLocation);
+ this.forceDrops = false; // Paper
super.finishConversion(world);
}