Coder Social home page Coder Social logo

Comments (10)

Barteks2x avatar Barteks2x commented on June 16, 2024

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.

from moreoverlays.

feldim2425 avatar feldim2425 commented on June 16, 2024

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.

from moreoverlays.

Barteks2x avatar Barteks2x commented on June 16, 2024

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.

from moreoverlays.

feldim2425 avatar feldim2425 commented on June 16, 2024

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

from moreoverlays.

Barteks2x avatar Barteks2x commented on June 16, 2024

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

from moreoverlays.

feldim2425 avatar feldim2425 commented on June 16, 2024

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.

from moreoverlays.

Barteks2x avatar Barteks2x commented on June 16, 2024

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

from moreoverlays.

Barteks2x avatar Barteks2x commented on June 16, 2024

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

from moreoverlays.

feldim2425 avatar feldim2425 commented on June 16, 2024

Oh sry. Forgot that one.

from moreoverlays.

MineCrak avatar MineCrak commented on June 16, 2024

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!

from moreoverlays.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.