Sponge icon indicating copy to clipboard operation
Sponge copied to clipboard

Transact OpenInventory from ServerPlayerGameModeMixin_Tracker

Open gabizou opened this issue 4 years ago • 0 comments

We're abusing a little bit of a hack to "get things working" for now with opening an Inventory, specifically redirecting the addListener call to not record all the slot changes for "populating" a menu container to be opened.

The mixin in question is: https://github.com/SpongePowered/Sponge/blob/353efebc69e96140e419655051bfe5321cc7a629/src/mixins/java/org/spongepowered/common/mixin/inventory/event/entity/player/ServerPlayerEntityMixin_Inventory.java#L52-L55

What I propose we can do is form a more explicitly defined transaction for the Transactor to throw the event and handle the return value for the interaction. Likewise, what this means is that the return value stipulates that the player may perform a "swing arm" animation for a non-failed interaction.

gabizou avatar Aug 08 '21 18:08 gabizou