From 1f5b6aea9710717139e9dff7377736280028f186 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Mon, 18 Jul 2022 20:53:55 +0800 Subject: [PATCH] Fix container owner reset on close --- .../mixin/core/world/entity/player/ServerPlayerMixin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java index ff726644..bb6d559e 100644 --- a/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java +++ b/arclight-common/src/main/java/io/izzel/arclight/common/mixin/core/world/entity/player/ServerPlayerMixin.java @@ -728,9 +728,10 @@ public abstract class ServerPlayerMixin extends PlayerMixin implements ServerPla @Inject(method = "doCloseContainer", at = @At("HEAD")) private void arclight$invClose(CallbackInfo ci) { if (this.containerMenu != this.inventoryMenu) { + var old = ArclightCaptures.getContainerOwner(); ArclightCaptures.captureContainerOwner((ServerPlayer) (Object) this); CraftEventFactory.handleInventoryCloseEvent((ServerPlayer) (Object) this); - ArclightCaptures.resetContainerOwner(); + ArclightCaptures.captureContainerOwner(old); } }