Wilyicaro / Legacy-Minecraft

This mod adapts all the features from old Minecraft Legacy Console edition
MIT License
148 stars 40 forks source link

Fix a renderer crash with worlds that don't extend the vanilla client world #470

Closed maruohon closed 3 months ago

maruohon commented 3 months ago

This is meant to fix a crash that happens with Litematica installed. Possibly the same issue as in #378.

However I haven't tested if this fixes all issues, as apparently running gradlew build doesn't actually build the proper jar? It gave me an almost empty jar that was only 261 bytes in size. I don't know how this Architectury-Loom tool chain works...

Wilyicaro commented 3 months ago

You need to run the build of the specific mod loader you are going to use. I will accept your PR, but I believe I made a mistake in this code, it would be better to simply use Minecraft.getInstance().level than what is in the argument

maruohon commented 3 months ago

But if you are injecting into vanilla rendering code that other mods might also use (which is the case here with Litematica) and which takes in the world as an argument, then you shouldn't assume that the renderer is running for the vanilla client world.

I think it would often be better if other mods' rendering code wouldn't happen for Litematica's rendering, but for now it's kinda unavoidable since Litematica is still using many of the vanilla rendering methods, and other mods obviously need to do stuff there for whatever they are doing. I'm slowly in the process or rewriting the Litematica renderer, and the new renderer will use a lot less (ideally almost none) of the vanilla rendering code, so it should hopefully avoid lots of the current issues with other mods. Let's just hope that the mostly custom code won't then also cause tons of new incompatibility issues with some mods though... :thinking:

Wilyicaro commented 3 months ago

It's just to find the actual biome, not for rendering, so there won't be problems