aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0688-Add-a-bunch-of-missing-forceDrop-toggles.patch
blob: 8e69a76f25c6ef89def0276d708f2ca054c29931 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
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
index 306aa8c36be92d66ebcc6b7e0dbb9dee6ec41a9b..8db4fc59b99694d2b15af188fc1c39ccf0090a8d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
@@ -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
index de4e35305f08cc92876f51edadbe69a620a8166e..f65d32245556e2acab927a29626749edea980f0a 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
@@ -305,7 +305,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);
     }