KubeJS

KubeJS

83M Downloads

Enum behaves differently if another mod is installed

alegian opened this issue ยท 5 comments

commented

Minecraft Version

1.21.1

KubeJS Version

2101.7.1-build.181

Rhino Version

2101.2.7-build.74

Architectury Version

none

Forge/Fabric Version

Neoforge 21.1.179

Describe your issue

Normally, the following is a valid startup script (tested):

StartupEvents.registry("block", p => {
    p.create("doensnt_matter").renderType("translucent")
})

But when I install my mod together with Kubejs (im a developer), it throws a startup NullPointerException. To get it to work, I need to replace the BlockRenderType string with its numerical ordinal of the enum:

StartupEvents.registry("block", p => {
    p.create("doensnt_matter").renderType(3)
})

Its super weird that the same builder function works, with different arguments. The existence of my mod seems to somehow change the parsing process of that argument??

Information about my mod: Its called Thavma (available for download everywhere), and it uses KotlinForForge.

I have not found any other mod that makes this happen. The entire ATM10 pack works with string rendertypes.

startup.log

Crash report/logs

No response

commented

Do you have this issue at runtime (not in dev env)?
Or this is runtime?

commented

oh ok, now I see the stacktrace, it was a bug fixed in dev, try using the dev version 187 (just to test)

commented

@pietro-lopes thanks for the fast reply. It was at runtime, not dev. How can I install 187? The latest I can find is 181

commented

Oh i found it in the maven. Kubejs build 187 does not fix it. However, build 233 (latest) seems to run! So it seems maybe Thavma isnt at fault here. Any idea what the problem might have been?

commented

I released a mod that temp fixes the issue while the version is not yet released (won't be applied when released).

https://www.curseforge.com/minecraft/mc-mods/kubejs-tweaks