SPIGOT-6487: Fix issue with villagers picking up items in certain situations

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-06-03 12:14:36 +10:00
parent e42f86eb2d
commit 1ac55ed273

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/world/InventorySubcontainer.java
+++ b/net/minecraft/world/InventorySubcontainer.java
@@ -13,13 +13,69 @@
@@ -13,13 +13,71 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
@ -56,8 +56,10 @@
+ }
+
+ public InventorySubcontainer(InventorySubcontainer original) {
+ this.a = original.a;
+ this.items = NonNullList.a(ItemStack.b, original.items.toArray(new ItemStack[0]));
+ this(original.a);
+ for (int slot = 0; slot < original.a; slot++) {
+ this.items.set(slot, original.items.get(slot).cloneItemStack());
+ }
+ }
+
public InventorySubcontainer(int i) {