mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 18:45:54 +01:00
107 lines
5.6 KiB
Diff
107 lines
5.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
|
|
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 2db5d8a937c841718e7b568c215109c39775d82c..0a18108fda778af5b600f77533770bd98584d60e 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java
|
|
@@ -528,7 +528,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
|
|
}
|
|
|
|
}
|
|
@@ -652,7 +654,9 @@ public class Panda extends Animal {
|
|
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));
|
|
@@ -929,7 +933,9 @@ public class Panda extends Animal {
|
|
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;
|
|
|
|
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 035c0ff01000f3fd57e1fcab13b93cafb133a169..7b42f7bd100808cb2367d0d7c7361e8f2e597502 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
|
|
@@ -325,7 +325,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);
|
|
}
|
|
|
|
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
|
|
index e6d398f07564b4027552db9836e6da2c0972cd42..a3c28f327627b340905ba61238ce8454db0ec9ee 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
|
|
@@ -270,7 +270,9 @@ public class PiglinAi {
|
|
|
|
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);
|
|
@@ -330,7 +332,9 @@ public class PiglinAi {
|
|
|
|
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
|
|
index 4bb9730b6a42702e91467f980b9f045585039db3..5f68945264d138ae04d6bcbd5bde310b42e30713 100644
|
|
--- 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);
|