Persistent Creative Inventory

Persistent Creative Inventory

59 Downloads

RenderLayer binding crashes startup

AbsolemJackdaw opened this issue · 4 comments

commented

Mod loader

Forge

Minecraft version

1.18.2

Mod version

6.1.1

Modloader version

40.1.46

Modpack info

No response

If bug:

  • Can you reproduce this issue with relevant mods only?

If bug: The latest.log file

No response

Issue description

[00:04:07] [main/ERROR] [ne.mi.fm.ja.FMLModContainer/]: Exception caught during firing event: Render layers can only be set during client loading! This might ideally be done from `FMLClientSetupEvent`.
	Index: 1
	Listeners:
		0: NORMAL
		1: ASM: class snownee.kiwi.KiwiModules handleRegister(Lnet/minecraftforge/event/RegistryEvent$Register;)V
java.lang.IllegalStateException: Render layers can only be set during client loading! This might ideally be done from `FMLClientSetupEvent`.

I'm trying to add compatibility with your mod and am using cursemaven to use your mod as a runtimeonly compile.
when i try to launch my client, i get a crash and it basically tells that the kiwi mod is incorrectly registering their layers.

edit: ive also got fruit trees as a runtime only compile if that is of any interest.

commented

https://www.toptal.com/developers/hastebin/sijisuxaqa.sql

It only happens when I launch the data gen from forge. i can start the client just fine.

this is in my gradle build file

dependencies{
    runtimeOnly fg.deobf("curse.maven:kiwi-303657:3817086")
    runtimeOnly fg.deobf("curse.maven:fruit-trees-355467:3756371")
}

repositories { //all of these are for adding crates compat
    mavenLocal()
   
    maven {
        name = 'Curse Maven'
        url = 'https://cursemaven.com'
        content {
            includeGroup 'curse.maven'
        }
    }
}

here's the full gradle file
https://github.com/ArtixAllMighty/AppleCrates/blob/1.18/Forge/build.gradle

commented

it seems to be related to this

public static void handleRegister(RegistryEvent.Register<Block> event) {
MODULES.values().forEach(info -> info.registries.registries.keySet().forEach(info::handleRegister));
ModLoadingContext.get().setActiveContainer(null);

where you call moduleinfo#handleRegister, in which you bind layers.

ItemBlockRenderTypes.setRenderLayer(block, type);

the call is made in the block registry event, while the layers should best be set in the fmlclientsetupevent

commented

Could you provide a stacktrace? I can't reproduce the crash