Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reopen GUIs on update when not necessary to prevent flickering #220

Closed
wants to merge 19 commits into from
Closed

Conversation

jdkeke142
Copy link
Contributor

@jdkeke142 jdkeke142 commented Jun 3, 2022

A current problem with IF is that with each GUI update, even when only items are changed, it reopens the inventory which causes some kinds of flickering.

For a static GUI or one that updates rarely this is not a big concern. However, as stated in the issue #205, it becomes a bigger problem in GUIs that need to be updated more frequently.

This PR is intended to correct the problem without changing the external use of the API, now Gui#update will judge itself if it is necessary to reopen the GUI depending on whether it is considered dirty or not.

@jdkeke142 jdkeke142 changed the title Don't reopen GUIs on update when not necessary to prevent blinking Don't reopen GUIs on update when not necessary to prevent flickering Jun 4, 2022
@stefvanschie stefvanschie self-requested a review June 4, 2022 18:46
@stefvanschie stefvanschie changed the base branch from 0.10.6 to 0.10.7 June 13, 2022 18:04
@stefvanschie
Copy link
Owner

stefvanschie commented Jun 13, 2022

Thank you for your PR. I've changed the base to version 0.10.7, since I need more time to look at this and want to get an update out to add support for Minecraft 1.19.

@jdkeke142
Copy link
Contributor Author

Thank you for your PR. I've changed the base to version 0.10.7, since I need more time to look at this and want to get an update out to add support for Minecraft 1.19.

I see. If you want me to change anything let me know

Copy link
Owner

@stefvanschie stefvanschie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in getting to this. There are some guis that don't behave properly with these changes. In particular:

  • The AnvilGui doesn't place items back in the player inventory after updating the gui. An item on the cursor is also only visible after the gui has been updated.
  • In the BeaconGui, when you pick up an item from the player inventory, it becomes invisible/disappears.
  • For the CartographyTableGui, when you take an item from the top inventory the item is duplicated, but when you take an item form the bottom inventory it disappears.
  • In the CraftingTableGui, items in the player inventory aren't visible.
  • In the EnchantingTableGui taking an item causes it to become invisible/disappear.
  • In the GrindstoneGui when you take an item it is duplicated.
  • And for the StonecutterGui you cannot take any items, even if the event for this item is not cancelled.

The other guis seem to be working correctly.

@stefvanschie stefvanschie deleted the branch stefvanschie:0.10.7 August 11, 2022 19:11
@stefvanschie
Copy link
Owner

This was closed automatically along the deletion of the 0.10.7 branch, apologies for this. Feel free to create another PR for these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants