More Overlays

More Overlays

66M Downloads

Cubic Chunks compatibility

BaccarWozat opened this issue ยท 10 comments

commented

On any nonstandard world with terrain generation below Y=0, such as Cubic Chunks, light levels work fine but no Xs appear when MoreOverlays is toggled on. It does function at Y>0, even Y>255 and beyond.

This was not reported earlier because my CC testing involved many other mods as well, some of which seem to play havoc with light overlays.

Using MC 1.11.2, various Forges up to 2386, MoreOverlays 1.10-1.12 and various Cubic Chunks builds from 591 to 685.

commented

Ok I will not support that because Minecraft crashes if I want to get the light level below 0.

[16:26:06] [Server thread/INFO]: Unloading dimension 0
[16:26:06] [Server thread/INFO]: Unloading dimension -1
[16:26:06] [Server thread/INFO]: Unloading dimension 1
[16:26:07] [main/FATAL]: Unreported exception thrown!
java.lang.ArrayIndexOutOfBoundsException: -1
	at net.minecraft.world.chunk.Chunk.getLightFor(Chunk.java:691) ~[Chunk.class:?]
	at at.feldim2425.moreoverlays.lightoverlay.LightOverlayRenderer.getSpawnModeAt(LightOverlayRenderer.java:105) ~[LightOverlayRenderer.class:?]
	at at.feldim2425.moreoverlays.lightoverlay.LightOverlayRenderer.refreshCache(LightOverlayRenderer.java:95) ~[LightOverlayRenderer.class:?]
	at at.feldim2425.moreoverlays.lightoverlay.LightOverlayHandler.onClientTick(LightOverlayHandler.java:28) ~[LightOverlayHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_13_LightOverlayHandler_onClientTick_ClientTickEvent.invoke(.dynamic) ~[?:?]
	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?]
	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:179) ~[EventBus.class:?]
	at net.minecraftforge.fml.common.FMLCommonHandler.onPostClientTick(FMLCommonHandler.java:347) ~[FMLCommonHandler.class:?]
	at net.minecraft.client.Minecraft.runTick(Minecraft.java:2036) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1186) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]

I run Minecraft 1.12.1 with Forge version 14.22.0.2452... I tried to add a config option to disable the camps, but they are necessary if the client crashes when the player is below a certein Y level.

commented

That's because you are accessing the Chunk directly. World light access has builtin height checks.

commented

There is still Math.min(Math.max((int) player.posY, 0), player.world.getHeight()-1);

commented

Oh sry. Forgot that one.

commented

Hello, please make a new version build for this mod with that Nov 23 fix. We are compiling a 1.12.2 compatibility list for Cubic Chunks and I very much want to add this mod to it as we've all been getting great use out of Barteks2x's version for a while, but I need an official build version to reference in the list.

Thank you!

commented

I looked at the code, and the main issue is here, since there is no getMinHeight method, the only way to fix it is to either provide a config option or remove this height limit completely. I'm not exactly sure what is the point of it.

commented

Well the vanilla world has a fixed height and in my opinion it doesn't make sence so check light outside above or below the world. One reason is because light in vanilla sometimes breaks above the world another reason is other mods and also minecraft itself, has no support for that.

I'm not sure if it is "good" to just fix it by removing the clamps.

commented

Vanilla has builtin height checks for lighting and returns some sane values there (iirc it's zero below y=0, and value at max height above y=255). And since most of the time the player isn't going to be near the height bound, that check on your side doesn't give any real performance advantage.

I'm also not sure what you mean by "that" in "other mods and also minecraft itself, has no support for that".
If you are talking about the cubic chunks mod itself - you are right that many mods don't support it. But it's not a good reason to ignore the mod.
If it's "light above or below the world" - vanilla just has a different idea for where is the bottom of the world. So it's back to not supporting cubic chunks.

You are still free to not support it, and there would be one less cubic chunks-compatible mod.

commented

Ok. I think i will at least add a config option to disable checks or disable checks if I can find that mod.

commented

Just so you know, currently it's not on curseforge, but will be sometime soon, it's on github: https://github.com/OpenCubicChunks/CubicChunks