Fix opening mod containers

This commit is contained in:
IzzelAliz 2021-02-10 23:16:00 +08:00
parent afb33f16de
commit 2f4e7e9a58

View File

@ -667,7 +667,9 @@ public abstract class ServerPlayerEntityMixin extends PlayerEntityMixin implemen
if (container != null) { if (container != null) {
((ContainerBridge) container).bridge$setTitle(itileinventory.getDisplayName()); ((ContainerBridge) container).bridge$setTitle(itileinventory.getDisplayName());
boolean cancelled = false; boolean cancelled = false;
ArclightCaptures.captureContainerOwner((ServerPlayerEntity)(Object)this);
container = CraftEventFactory.callInventoryOpenEvent((ServerPlayerEntity) (Object) this, container, cancelled); container = CraftEventFactory.callInventoryOpenEvent((ServerPlayerEntity) (Object) this, container, cancelled);
ArclightCaptures.resetContainerOwner();
if (container == null && !cancelled) { if (container == null && !cancelled) {
if (itileinventory instanceof IInventory) { if (itileinventory instanceof IInventory) {
((IInventory) itileinventory).closeInventory((ServerPlayerEntity) (Object) this); ((IInventory) itileinventory).closeInventory((ServerPlayerEntity) (Object) this);