amadornes / MCMultiPart

A universal multipart API for Modern Minecraft
Other
67 stars 23 forks source link

[1.9] MCMP registers models for my parts with incorrect locations, causing useless log spam #24

Closed bdew closed 8 years ago

bdew commented 8 years ago

I'm getting a bunch of warnings like

[23:08:28] [Client thread/ERROR] [FML]: Exception loading model for variant covers:corner#multipart for blockstate "minecraft:air"

But all my parts are using "covers:microblock" as their model (since it's shared between them) and return that from getModelPath while "covers:corner" is the type of the part.

In game they use the correct model, so i guess MCMP is just registering the wrong names somewhere along with the right one.

amadornes commented 8 years ago

I think I just figured it out... You're creating your blockstate with a null block, which Forge's registries translate to an air block and air block is serialized as "minecraft:air". Changing the block in your blockstate to MCMultiPartMod.multipart should work. My guess is that it was attempting to bind the right blockstate to both the air block and the multipart block, so making that change should force it to be bound to the multipart block only.

bdew commented 8 years ago

Hm i'll try changing that, but still it somehow uses the "type" string as a model (or blockstate json i guess) resource location which doesn't make much sense to me.

amadornes commented 8 years ago

Did that fix it?

bdew commented 8 years ago

Sorry, didn't get around to checking yet - was busy with other stuff. Will check and report back tomorrow.

bdew commented 8 years ago

Sorry for the delay. Changing the block in the blockstate does not fix the warning, just makes it complain about a different block:

[08:01:58] [Client thread/ERROR] [FML]: Exception loading model for variant covers:corner#multipart for blockstate "mcmultipart:multipart"

The problem (i think) is that MultipartStateMapper takes the model path from MultipartRegistry.getStateLocation - which returns the part type, not model.

Added: PartState grabs the model path from part.getModelPath, not from forge registry, so when rendering the right model is loaded despite the warning.

amadornes commented 8 years ago

I'm assuming either MCMP fixed it or you did, and since nobody else has complained about it, I'm closing this. If it still happens... I'm really confused :/