Jump to content

1.9 Metadata items


DestinySpork

Recommended Posts

I have created a bunch of ingots which are all currently separate items, and I want to put them all into one item with metadata.

I have the items created, but cannot get the models to load. If I have an item using the model, it works in the meta item. However, once I unregister the ingot the model no longer loads on the meta item.

Is the item model not getting loaded by the meta item or something?

Thanks,

Destiny

 

PS. All variants of the meta item are registered in the ItemModelMesher, so that is not the issue.

Link to comment
Share on other sites

I have created a bunch of ingots which are all currently separate items, and I want to put them all into one item with metadata.

I have the items created, but cannot get the models to load. If I have an item using the model, it works in the meta item. However, once I unregister the ingot the model no longer loads on the meta item.

Is the item model not getting loaded by the meta item or something?

Thanks,

Destiny

 

PS. All variants of the meta item are registered in the ItemModelMesher, so that is not the issue.

Link to comment
Share on other sites

Post your code and the FML log (preferably using Gist), which should contain some indication as to what's going wrong.

 

You should be using Forge's

ModelLoader.setCustomModelResourceLocation

(for metadata-based models) or

ModelLoader.setCustomMeshDefinition

(for arbitrary

ItemStack

to

ModelResourceLocation

mappings) methods in preInit rather than

ItemModelMesher#register

in init.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Post your code and the FML log (preferably using Gist), which should contain some indication as to what's going wrong.

 

You should be using Forge's

ModelLoader.setCustomModelResourceLocation

(for metadata-based models) or

ModelLoader.setCustomMeshDefinition

(for arbitrary

ItemStack

to

ModelResourceLocation

mappings) methods in preInit rather than

ItemModelMesher#register

in init.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

ModelLoader#setCustomModelResourceLocation crashes the game with a nullpointer, log here:

https://gist.github.com/anonymous/e51d50dc534d1536fd6fd4893d543f4f

 

Edit:

If it's put in postInit it doesn't crash. It just doesn't work either. You say to put it in preInit, but my items are not registered until Init. I tried registering in preInit and it crashed. Maybe my whole setup is just weird.

Link to comment
Share on other sites

ModelLoader#setCustomModelResourceLocation crashes the game with a nullpointer, log here:

https://gist.github.com/anonymous/e51d50dc534d1536fd6fd4893d543f4f

 

Edit:

If it's put in postInit it doesn't crash. It just doesn't work either. You say to put it in preInit, but my items are not registered until Init. I tried registering in preInit and it crashed. Maybe my whole setup is just weird.

Link to comment
Share on other sites

Ok, I seem to have it sorted.

 

My proxies were messed up, so it turned out preInit wasn't getting called on the common proxy. That would explain things.

 

ModelLoader.setCustomModelResourceLocation goes in preInit

setCustomModelResourceLocation.register goes in Init (or it gets null items and crashes)

OBJLoader goes in preInit

 

If the modelmesher should be in preInit then... it works in Init so it's going to stay like that unless there is a good reason not to.

 

 

This thread can now be closed.

Link to comment
Share on other sites

Ok, I seem to have it sorted.

 

My proxies were messed up, so it turned out preInit wasn't getting called on the common proxy. That would explain things.

 

ModelLoader.setCustomModelResourceLocation goes in preInit

setCustomModelResourceLocation.register goes in Init (or it gets null items and crashes)

OBJLoader goes in preInit

 

If the modelmesher should be in preInit then... it works in Init so it's going to stay like that unless there is a good reason not to.

 

 

This thread can now be closed.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.