SPIGOT-6506: Fix crash with custom inventories

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-06-11 19:10:28 +10:00
parent 0acd422f48
commit dd358f1352
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,15 @@
public abstract class Container {
public static final int SLOT_CLICKED_OUTSIDE = -999;
@@ -43,7 +57,7 @@
public NonNullList<Slot> slots = NonNullList.a();
private final List<ContainerProperty> dataSlots = Lists.newArrayList();
private ItemStack carried;
- private final NonNullList<ItemStack> remoteSlots;
+ public NonNullList<ItemStack> remoteSlots;
private final IntList remoteDataSlots;
private ItemStack remoteCarried;
@Nullable
@@ -57,6 +71,27 @@
private ContainerSynchronizer synchronizer;
private boolean suppressRemoteUpdates;

View File

@ -223,6 +223,7 @@ public class CraftContainer extends Container {
if (delegate != null) {
this.lastSlots = delegate.lastSlots;
this.slots = delegate.slots;
this.remoteSlots = delegate.remoteSlots;
}
// SPIGOT-4598 - we should still delegate the shift click handler