Fabric API

Fabric API

106M Downloads

How should I use ModelLoadingRegistry

FishMagic opened this issue ยท 1 comments

commented

Discussed in https://github.com/orgs/FabricMC/discussions/3456

Originally posted by FishMagic December 3, 2023

Description

I want to load some model by using ModelLoadingRegistry in Minecraft 1.19.2, and I try to use the code below

 ModelLoadingRegistry.INSTANCE.registerModelProvider { _, out ->
            listOf(
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_clear_soup_bubble"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_clear_soup"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_spicy_soup_bubble_small"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_spicy_soup_bubble_large"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_spicy_soup_floating_pepper_1"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_spicy_soup_floating_pepper_2"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_spicy_soup"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_cheese_soup_bubble"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_cheese_soup"),
                Identifier(EveryXHotpot.MOD_ID, "soup/hotpot_lava_soup"),
                Identifier(EveryXHotpot.MOD_ID, "item/hotpot_chopstick_model"),
                Identifier(EveryXHotpot.MOD_ID, "block/hotpot_plate_long"),
                Identifier(EveryXHotpot.MOD_ID, "block/hotpot_plate_small"),
                Identifier(EveryXHotpot.MOD_ID, "block/hotpot_chopstick_stand"),
                Identifier(EveryXHotpot.MOD_ID, "item/hotpot_spice_pack_model")
            ).forEach { out.accept(it) }

But I get some warns like Unable to load model: 'everyxhotpot:hotpot_long_plate#inventory' referenced from: everyxhotpot:hotpot_long_plate#inventory: java.lang.IllegalStateException: Circular reference while loading everyxhotpot:item/hotpot_long_plate, and get the texture missing blocks in game. So, how can I fix it.

Full code can be got here

commented

๐Ÿ‘‹ We use the issue tracker exclusively for final bug reports and feature requests. However, this issue appears to be better suited for either a discussion thread, or a message on our discord server. Please post your request on one of these, and the conversation can continue there.