Nothirium 0.2.x causes some Compact Machine walls to be invisible
jchung01 opened this issue ยท 3 comments
Disclaimer: If applicable please set the openGLDebugOutput -> enabled
config option from RenderLib to true and try to reproduce the issue.
Describe the bug
After updating Nothirium from 0.1.10 (and RenderLib), Compact Machine walls while in a compact machine are invisible. The walls are only invisible at y=48 and above.
Reproducibility
- I reproduced this issue with as few other mods as possible installed.
- I am unable to reproduce this issue consistently.
To Reproduce
Steps to reproduce the behavior.
- Place a Normal, Large, Giant, or Maximum Compact Machine.
- Click on the compact machine with a Personal Shrinking Device.
- See that the Solid Compact Machine Walls at y=48 and above are invisible.
Screenshots/Videos
What a (maximum) compact machine looks like:
What it looks like with updated Nothirium:
Versions
Nothirium: >= 0.2.0
RenderLib: >= 1.2.5
Forge: 14.23.5.2860
Minecraft: 1.12.2
Other mods (necessary to reproduce the bug):
MixinBooter: 7.0 (I tried using MixinBootstrap, same issue)
Compact Machines: 3.0.18-b278
Hardware
CPU: Intel i7-2600
RAM: 16GB DDR3 1333Mhz
GPU: NVIDIA GTX 960
VRAM: 2GB
Log File
debug.log
Update: Compact Machines 3.0.18-b278 doesn't include this overhaul, but there are no plans to publish that overhaul to Curseforge (see image). However, using a manually built jar that does include those overhaul changes actually fixes this rendering bug.
Also, for more info, Compact Machines in CubeTools seems to check if it should render certain sides of a compact machine wall depending on the block's position. I suspect that's part of the issue, but I don't see how the mentioned commit's changes for that file would have fixed the rendering for specifically walls at y>=48.
I'm not sure if you're willing to see if you can fix it on Nothirium's side, but I think that does help narrow down where the issue could be. If you want to close this and settle it as an incompatibility of newer versions of Nothirium and Compact Machines, that's fine though.
After debugging a bit, the reason for this issue is a combination of Compact Machine's unusual use of BlockWall#shouldSideBeRendered
(which is itself a deprecated method) and the use of SectionRenderCache
in Nothirium 0.2.x+. CubeTools#shouldSideBeRendered
calls CubeTools#getCubeSize
, which relies on IBlockAccess#getBlockState
to infer the compact machine's size. However, the y position of the passed BlockPos is not considered, so getting the block state will always fail for y >= 48
because SectionRenderCache
only has block state data for it's specific section of y=48~64
. This explains why the walls are only invisible at y >= 48
.
This issue does not arise in earlier versions of Nothirium because it is before the rework of using SectionRenderCache
instead of ChunkCache
, which has block state data for the whole chunk. This issue is also fixed in the overhauled version of Compact Machines because of the way shouldSideBeRendered
is reworked to avoid calls to getBlockState
entirely.
A solution then is to simply mixin to Compact Machines's CubeTools
to infer the compact machine's size/dimensions while also using the block position's y-value, which is what is done in the above PR.