Fix container owner reset on close

This commit is contained in:
IzzelAliz 2022-07-18 20:53:55 +08:00
parent 3a1700a608
commit 1f5b6aea97
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338

View File

@ -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);
}
}