MehVahdJukaar / Supplementaries

Other
147 stars 107 forks source link

[🐞]: Getting a nullable Pos with Supplementaries & Axiom #1236

Open zipCoder933 opened 4 days ago

zipCoder933 commented 4 days ago

Before Continuing:

Version

1.20.1-FORGE

Supplementaries Version

supplementaries-1.20-2.8.18

Moonlight Lib Version

moonlight-1.20-2.13.26-forge

Issue Detail

The game crashes whenever trying to enter a minecraft world. supplementaries and Axiom (v4.1.1, MC1.20.1) is installed (https://modrinth.com/mod/axiom/version/4.1.1) (This problem doesn't occur when axiom is not installed)

java.lang.NullPointerException: Cannot invoke "net.minecraft.core.BlockPos.m_123343_()" because "pos" is null
    at net.mehvahdjukaar.supplementaries.client.LumiseneFluidRenderProperties.getStillTexture(LumiseneFluidRenderProperties.java:33) ~[supplementaries-1.20-3.0.0.jar%23345!/:?]
    at net.minecraftforge.client.ForgeHooksClient.getFluidSprites(ForgeHooksClient.java:491) ~[forge-1.20.1-47.3.7-universal.jar%23367!/:?]
    at net.fabricmc.fabric.impl.client.rendering.fluid.FluidRendererCompat$ForgeFluidRenderHandler.getFluidSprites(FluidRendererCompat.java:60) ~[fabric-rendering-fluids-v1-3.0.28+4ac5e37a77.jar%23544!/:3.0.28+4ac5e37a77]
    at net.minecraft.client.renderer.texture.TextureAtlas.handler$fjo001$axiom$cycleAnimationFrames(TextureAtlas.java:2546) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]

    at net.minecraft.client.renderer.texture.TextureAtlas.m_118270_(TextureAtlas.java:108) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.renderer.texture.TextureAtlas.m_7673_(TextureAtlas.java:120) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.renderer.texture.TextureManager.m_7673_(TextureManager.java:163) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.Minecraft.m_91398_(Minecraft.java:1760) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1112) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23362!/:?]
    at net.minecraft.client.main.Main.main(Main.java:218) ~[forge-47.3.7.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
    at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.runTarget(CommonLaunchHandler.java:111) ~[fmlloader-1.20.1-47.3.7.jar:?]
    at net.minecraftforge.fml.loading.targets.CommonLaunchHandler.clientService(CommonLaunchHandler.java:99) ~[fmlloader-1.20.1-47.3.7.jar:?]

Log

latest.log

MehVahdJukaar commented 4 days ago

idk what axiom is but 100% their issue as you cansee from here image

they are passing null to a method that does not accept null

MehVahdJukaar commented 4 days ago

also you arent using latest version

MehVahdJukaar commented 4 days ago

also why is it even calling fabric api call when supp is a forge mod and you do have the forge version

zipCoder933 commented 3 days ago

The issue occurred on the latest version of supplementaries too, however I didn't log it when I tested it on that version. Any version of supplementaries after 3.0.0 will crash when Axiom is installed.

The reason why it might look like am using fabric, is because axiom is a fabric mod and I am using sinytra connector to run it in my forge modpack.

MehVahdJukaar commented 3 days ago

In that case it could even be a connector issue

zipCoder933 commented 1 day ago

Any version of moonlight api at or before V2.13.0 works fine (later versions could also be ok as well, I just haven't tested them all)

And any version of supplementaries before v3.0.0 doesn't crash

While other mods may be contributing to the crash, something must be happening in supplementaries, post 3.0.0 that is also contributing to the crash.

zipCoder933 commented 1 day ago

Any version of moonlight api at or before V2.13.0 works fine (later versions could also be ok as well, I just haven't tested them all)

And any version of supplementaries before v3.0.0 doesn't crash

While other mods may be contributing to the crash, something must be happening in supplementaries, post 3.0.0 that is also contributing to the crash.

MehVahdJukaar commented 1 day ago

well its obvious that it doesnt crash before 3.0.0 as there i didnt have added a new liquid

MehVahdJukaar commented 1 day ago

as ive said from the log it looks very clear that some mod is passing a null position in one of my methods and thats invalid

zipCoder933 commented 5 hours ago

Ok. It seems like supplementaries.client.LumiseneFluidRenderProperties.getStillTexture is where the null pointer is being passed into.

This corresponds the crash that occurs because axiom is changing the rendered fluid opacity

Is it possible to somehow gracefully handle the null pointer? Somehow handing it in said method in a way that wont crash the game?

MehVahdJukaar commented 15 minutes ago

It is but adding random null checks that are not needed is bad practice just as adding random try catch statement that don't throw as they hide issues.

MehVahdJukaar commented 1 minute ago

https://github.com/Sinytra/ForgifiedFabricAPI/issues/172