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

@ZetaLoadModule(clientReplacement = true) is pretty broken #5

Closed
Jorue23 opened this issue Mar 4, 2024 · 2 comments
Closed

@ZetaLoadModule(clientReplacement = true) is pretty broken #5

Jorue23 opened this issue Mar 4, 2024 · 2 comments

Comments

@Jorue23
Copy link

Jorue23 commented Mar 4, 2024

Now I tried to disable "Expanded Item Interactions" for Quark. This caused some weird issues with ghost items as already reported here: VazkiiMods/Quark#4711 .

Now I played around a bit with the source code of Quark. While doing so I removed the code of this booleean https://github.com/VazkiiMods/Quark/blob/e3a3bf167935c6d5e1e3c0514853ba71e3dedaf2/src/main/java/org/violetmoon/quark/content/management/module/ExpandedItemInteractionsModule.java#L190 and only left the return false. I expected this to produce the result that gatherTooltip https://github.com/VazkiiMods/Quark/blob/d4a601088f676f4e598648b047bf56541d3548ea/src/main/java/org/violetmoon/quark/content/management/module/ExpandedItemInteractionsModule.java#L378 wouldn't render the tooltip anymore because it relies on armorOverride being true. Now this confused me because it changed nothing even tho it should've. So I just tried around and also removed gatherTooltip leaving an empty function. Now since gatherTooltip is inside a class annotated with "@ZetaLoadModule(clientReplacement = true)" this lead me to the presumption that the client replacement doesn't work at all. I'm not advanced enough in minecraft modding to figure out more information but maybe you can figure out why this behaviour is happening.

@quat1024
Copy link
Collaborator

quat1024 commented Jun 4, 2024

Hmm...

So clientReplacement is designed for modules that need to be different on the server and the client. On the dedicated server the outer module is loaded, and on the client the clientReplacement module is loaded instead.

Basically at some point the server calls new ExpandedItemInteractionsModule() and the client calls new ExpandedItemInteractionsModule.Client(). Because ZRenderTooltip is a client-only event, it can't go into ExpandedItemInteractionsModule because classloading that event on the server will crash.

That is the only thing clientReplacement does, so if you are seeing any tooltips from ExpandedItemInteractionsModule that means the clientReplacement functionality is working. I'm thinking maybe there is some other problem with the logic of the Quark module.

@Jorue23
Copy link
Author

Jorue23 commented Jun 4, 2024

Ok yeah makes sense then I understood the clientReplacement wrong. Sorry!

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

No branches or pull requests

2 participants