opekope2 / OptiGUI

Blazing fast custom GUI textures on Fabric and Quilt with built-in OptiFine custom GUI resource pack support
https://opekope2.dev/OptiGUI/
MIT License
23 stars 6 forks source link

Custom name is still broken #5

Closed opekope2 closed 1 year ago

opekope2 commented 2 years ago

It was never fixed. The client always forgets NBT information as soon as block entities get unloaded.

opekope2 commented 2 years ago

Custom names are stored in NBT, which is sent by the server for most block entities, but not for chests. Custom name matching works for most block entities, except for chests.

opekope2 commented 2 years ago

Apparently, the server doesn't send the NBT after restarting, so it's still broken

Julienraptor01 commented 1 year ago

This mod on server resolve the issue https://modrinth.com/mod/know-my-name

opekope2 commented 1 year ago

I haven't seen this mod, thanks for sending it. Also, custom names appear on the top of the GUI, which should work on a vanilla server. I tried to use a method to query nbt of a block entity (similar to what F3+I does), but that requires some permissions (which is not always granted). There was a time when the OptiGUI code world run on the server side, which kind of worked on a local world, but not on a remote server. This feature was not intended and OptiGUI no longer does anything on server-side.

Julienraptor01 commented 1 year ago

Maybe you could add it in description just like animatica for people who want to solve that problem

opekope2 commented 1 year ago

Yeah, I'll do it soon. Much easier to do, until I have time to fix this (and other bugs)

emielderckx commented 1 year ago

We implemented the same fix into Purpur in July, so that OptiGUI could work

https://github.com/PurpurMC/Purpur/blob/ver/1.19.3/patches/server/0277-Send-client-custom-name-of-BE.patch

opekope2 commented 1 year ago

Custom name is finally fixed by a workaround by using Interaction.screenTitle as a fallback, as seen on line 59:

https://github.com/opekope2/OptiGUI-Next/blob/2735ac588f0857ee04f1f03b4986f5060b817a28/src/main/kotlin/opekope2/optigui/internal/mc_all/Util.kt#L55-L61

I'll leave this here in case anyone wants to develop filters for OptiGUI.