NichtStudioCode / InvUI

A spigot library for creating custom inventory-based GUIs.
MIT License
253 stars 20 forks source link

Massively reduce gui opening times and general latency issues #70

Closed Emibergo02 closed 5 months ago

Emibergo02 commented 5 months ago

Every time a itemstack is set in an inventory, InvUI sends an update Container packet. How to reproduce: Create a new merged GUI use https://github.com/adepierre/SniffCraft to see packet sent to the client More info here -> https://discord.com/channels/859080327096172544/1005893933458538537/1243500973805277185

NichtStudioCode commented 5 months ago

This would need some investigation on what the issue that is mentioned in that comment here was, because I don't remember. But getViewer() != null could definitely be replaced with isOpen(), as that is what the original intention here was (before some viewer-related refactoring that changed this behavior)

NichtStudioCode commented 5 months ago

As expected, this breaks on 1.16.5 (and presumably all versions below that as well)

With Player#updateInventory:

https://github.com/NichtStudioCode/InvUI/assets/51272202/f0ffb639-bb07-4747-a9de-8215e263ebfd

Without Player#updateInventory:

https://github.com/NichtStudioCode/InvUI/assets/51272202/edbc5222-af10-4198-80d2-cd9045b65592