Skip to content

Conversation

@calmilamsy
Copy link
Member

Tin, AAAAAAAAAAAAAAA

@mineLdiver
Copy link
Member

This causes double invocation of onClose in CraftingScreenHandler and every existing screen handler that might have implemented a manual call to onClosed from the screen's removed method override.

@Environment(value=EnvType.CLIENT)
public class CraftingScreen
extends HandledScreen {
    public CraftingScreen(PlayerInventory inventory, World world, int x, int y, int z) {
        super(new CraftingScreenHandler(inventory, world, x, y, z));
    }

    public void removed() {
        super.removed();
        this.container.onClosed(this.minecraft.player);
    }

So I think a better solution would be to create a StationHandledScreen class/interface or something that'd have the intended behavior by applying the same fix (calling the handler's onClose from a removed override) under the hood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants