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

This commit is contained in:
md_5 2021-06-03 12:14:36 +10:00
parent 90a4d64a9a
commit ebe18b9b0e
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

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) {