Occultism Dictionary of Spirits blank in the book preview alongside JourneyMap
Kevin-Marsh opened this issue ยท 10 comments
Describe the bug
The Dictionary is blank in the images that are meant to preview the pentacles.
To Reproduce
Install Modnomicon, Occultism, and Journeymap
Expected behavior
The Pentacle should render.
System (please complete the following information):
- Modonomicon Version: 1.92.1
- Occultism Version: 1.134.4
- Journeymap Version: 6.0.0-beta.13
- OS: Windows
- Minecraft Version: 1.21
- Neoforge Version: 21.0.42
Hmm journeymap seems to modify the posestack leading to Z-issues.
Various other pages also do not work, e.g. rendering items on recipe pages.
Moreover, it looks like this only affects wherever I use vanilla render methods to render minecraft contents such as blocks or items.
This seems to me like something journeymap should not do or rather clean up the guigraphics and posestack after their rendering. However, it is possible that I am missing a best practice convention to guard against this.
Could you open an issue with journeymap as well and link to this one @Kevin-Marsh to figure out on which side it needs to be fixed?
looks like something is going on with layering.
Where in your code are you drawing that book over the screen?
Ahh okay, so this seems to be an issue with the gui layering logic
To be honest, I used to use this a lot too and it caused nothing but problems with other mods. So I switched to a similar implementation as the net.minecraft.client.gui.components.PopupScreen
Then I no longer needed to use hacky stuff in Fabric which did not have an API for layering screens. Then I stopped having tons of mod conflicts in all mod loaders.
The root cause of this issue.
This issue is happening because the Screen events are firing for every layer, when in reality, the pre event should fire once before the first layer or NeoForge should add a new event. So the minimap is drawing for every screen layer when it should only be drawing for the first layer. The event has no way to signify to consumers what layer it is on.
I fixed this on my end for the next beta.
But you will continue to run into problems with mods using gui-layering. Mainly due to the patches in GameRenderer Forge and Neoforge does with the farplane translations and ortho this does.
Getting off gui-layering will cause less headaches.
This was my solution, based on the realms popup screen.
https://github.com/TeamJM/journeymap-api/blob/1.21.x_2.0/common/src/main/java/journeymap/api/v2/client/ui/component/LayeredScreen.java
I fixed this on my end for the next beta.
But you will continue to run into problems with mods using gui-layering. Mainly due to the patches in GameRenderer Forge and Neoforge does with the farplane translations and ortho this does.
Getting off gui-layering will cause less headaches.
Thanks a lot! I am using a custom layering system in Fabric to show book parts on top of each other, maybe I can adopt that for the other loaders as well
This was my solution, based on the realms popup screen. https://github.com/TeamJM/journeymap-api/blob/1.21.x_2.0/common/src/main/java/journeymap/api/v2/client/ui/component/LayeredScreen.java
I had no idea the realms popup even existed! Thanks! I think mine is very similar although it has a few more overrides that are apparently not necessary. I'll compare
It was added in 1.20.1 or 4 I think. it is a much simpler solution.
It does have the disadvantage that you cannot make any screen layered. But, for me that is fine.
@mysticdrew Can you take a look at this enigmatica issue: EnigmaticaModpacks/Enigmatica10#17 (comment)
I suspect this is related to your fix or the underlying issue.
@klikli-dev Journeymap 13 didn't have the fix in it. It was only shipped today in beta 14