2021-07-22 04:58:24 +02:00
|
|
|
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
|
2023-03-14 21:25:13 +01:00
|
|
|
index ac0cfdef53ec82665acf362235842de4f17bfdd1..05c1e8c9f013547d4fcdbbd299329166a8ece1b0 100644
|
2021-07-22 04:58:24 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java
|
2023-03-14 21:25:13 +01:00
|
|
|
@@ -87,7 +87,9 @@ public class WorkAtComposter extends WorkAtPoi {
|
|
|
|
simpleContainer.removeItemType(Items.WHEAT, m);
|
|
|
|
ItemStack itemStack = simpleContainer.addItem(new ItemStack(Items.BREAD, l));
|
|
|
|
if (!itemStack.isEmpty()) {
|
2021-07-22 04:58:24 +02:00
|
|
|
+ entity.forceDrops = true; // Paper
|
2023-03-14 21:25:13 +01:00
|
|
|
entity.spawnAtLocation(itemStack, 0.5F);
|
2021-07-22 04:58:24 +02:00
|
|
|
+ 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
|
2023-07-04 10:22:56 +02:00
|
|
|
index a190826d87ca5e05c408ef488986a29280b1b3d2..4f03e50d8d9d67aa9a62fbb3bdb14f5ba851e08a 100644
|
2021-07-22 04:58:24 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -531,7 +531,9 @@ public class Panda extends Animal {
|
2021-07-22 04:58:24 +02:00
|
|
|
}
|
|
|
|
|
2023-06-08 04:04:01 +02:00
|
|
|
if (!this.level().isClientSide() && this.random.nextInt(700) == 0 && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
2021-07-22 04:58:24 +02:00
|
|
|
+ this.forceDrops = true; // Paper
|
|
|
|
this.spawnAtLocation((ItemLike) Items.SLIME_BALL);
|
|
|
|
+ this.forceDrops = false; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -655,7 +657,9 @@ public class Panda extends Animal {
|
2022-10-27 02:32:03 +02:00
|
|
|
ItemStack itemstack1 = this.getItemBySlot(EquipmentSlot.MAINHAND);
|
|
|
|
|
|
|
|
if (!itemstack1.isEmpty() && !player.getAbilities().instabuild) {
|
|
|
|
+ this.forceDrops = true; // Paper
|
|
|
|
this.spawnAtLocation(itemstack1);
|
|
|
|
+ this.forceDrops = false; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(itemstack.getItem(), 1));
|
2023-07-04 10:22:56 +02:00
|
|
|
@@ -932,7 +936,9 @@ public class Panda extends Animal {
|
2022-10-27 02:32:03 +02:00
|
|
|
ItemStack itemstack = Panda.this.getItemBySlot(EquipmentSlot.MAINHAND);
|
|
|
|
|
|
|
|
if (!itemstack.isEmpty()) {
|
|
|
|
+ Panda.this.forceDrops = true; // Paper
|
|
|
|
Panda.this.spawnAtLocation(itemstack);
|
|
|
|
+ Panda.this.forceDrops = false; // Paper
|
|
|
|
Panda.this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
|
|
|
int i = Panda.this.isLazy() ? Panda.this.random.nextInt(50) + 10 : Panda.this.random.nextInt(150) + 10;
|
|
|
|
|
2021-07-22 04:58:24 +02:00
|
|
|
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
|
2023-06-08 04:04:01 +02:00
|
|
|
index 2c012e8d314e8b785300de3f810f95c7452b7348..7ef04ef7995b093eef022b397cda8c27c8faede0 100644
|
2021-07-22 04:58:24 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java
|
2023-06-08 04:04:01 +02:00
|
|
|
@@ -322,7 +322,9 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
|
2021-07-22 04:58:24 +02:00
|
|
|
@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);
|
|
|
|
}
|
|
|
|
|
2022-10-27 02:32:03 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
2023-06-08 04:04:01 +02:00
|
|
|
index 7611481c7e469a3b9eb4d00f4816adb7b190127e..092cdb889564903102dccfe7bf2e320a1eba5efe 100644
|
2022-10-27 02:32:03 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -270,7 +270,9 @@ public class PiglinAi {
|
2022-10-27 02:32:03 +02:00
|
|
|
|
|
|
|
private static void holdInOffhand(Piglin piglin, ItemStack stack) {
|
|
|
|
if (PiglinAi.isHoldingItemInOffHand(piglin)) {
|
|
|
|
+ piglin.forceDrops = true; // Paper
|
|
|
|
piglin.spawnAtLocation(piglin.getItemInHand(InteractionHand.OFF_HAND));
|
|
|
|
+ piglin.forceDrops = false; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
piglin.holdInOffHand(stack);
|
2022-12-07 21:16:54 +01:00
|
|
|
@@ -330,7 +332,9 @@ public class PiglinAi {
|
2022-10-27 02:32:03 +02:00
|
|
|
|
|
|
|
protected static void cancelAdmiring(Piglin piglin) {
|
|
|
|
if (PiglinAi.isAdmiringItem(piglin) && !piglin.getOffhandItem().isEmpty()) {
|
|
|
|
+ piglin.forceDrops = true; // Paper
|
|
|
|
piglin.spawnAtLocation(piglin.getOffhandItem());
|
|
|
|
+ piglin.forceDrops = false; // Paper
|
|
|
|
piglin.setItemInHand(InteractionHand.OFF_HAND, ItemStack.EMPTY);
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
2023-06-08 04:04:01 +02:00
|
|
|
index 06d4c1787b1ee4976e6ed1773d3ff7130aebc2d0..9948085f51659f9b896622251739343d658dd0b2 100644
|
2022-10-27 02:32:03 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java
|
|
|
|
@@ -250,7 +250,9 @@ public abstract class Raider extends PatrollingMonster {
|
|
|
|
double d0 = (double) this.getEquipmentDropChance(enumitemslot);
|
|
|
|
|
|
|
|
if (!itemstack1.isEmpty() && (double) Math.max(this.random.nextFloat() - 0.1F, 0.0F) < d0) {
|
|
|
|
+ this.forceDrops = true; // Paper
|
|
|
|
this.spawnAtLocation(itemstack1);
|
|
|
|
+ this.forceDrops = false; // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
this.onItemPickup(item);
|