TheGreyGhost / MinecraftByExample

Working sample code for the basic concepts in Minecraft and Forge.
Other
1.24k stars 187 forks source link

1.12.2 mbe05 not working #58

Closed Beethoven92 closed 4 years ago

Beethoven92 commented 4 years ago

Example 05, the dynamic web model, seems to not work in branch 1.12.2 (and probably other earlier branches). When i place the block it just appears as the purple-black missing model block, the item in inventory is appearing normally tough (the cobweb icon).

I checked the code multiple times, and everything seems fine, but unless i am missing something, there is no such models/block/smartblock/webmodel file in your assets folder, a path which is referenced in block_3d_web_statemapper_name.json as the model path, and is also referenced in the code of ModelLoader3DWeb class.

So, what is this "webmodel" file supposed to contain? I even tried creating that file myself but still the problem in game persists. I am not even sure why you would have to make a reference to this smartmodel/webmodel file in the statemapper, so because of that missing file in your repository i got very confused. Maybe it got accidentally deleted? If not then i have got no clue how to solve the issue, because the code is identical to yours. Any idea how to solve that? Cheers

TheGreyGhost commented 4 years ago

Hmm that's odd. Maybe I have stuffed it up by mistake while fixing another problem; it used to work fine in 1.12.2. I'll have a look in the next couple of days.

TheGreyGhost commented 4 years ago

Howdy I just tested it by downloading 1-12-2-final from scratch, and it seems to work fine? I'm not sure why it's not rendering properly for you.

The "webmodel" model doesn't exist as a json, if you look in ModelLoader3DWeb::loadModel, you'll see that during loading the loadModel method checks the model name (from block_3d_web_statemapper_name.json) to see if it is "smartmodel/webmodel", and if it matches -> then it generates a custom IModel instead of trying to load a json model.

-TGG

Beethoven92 commented 4 years ago

All right, but still a file named webmodel needs to exists, or not? And is there a way to do that without the loader checking for that path? Thank you for your time

TheGreyGhost commented 4 years ago

Hi No, there is no file needed in this example. The point of this example is to show that you can use a loader to generate a dynamic model from scratch. The name "webmodel" is just a flag that the loader can use however it wants. Forge won't try to load a "webmodel.json" because the mbe05 loader has told Forge that it will handle the loading / model generation by itself. Other loaders (eg wavefront object) do usually have a file yes, because they read the file to configure the model.

Beethoven92 commented 4 years ago

Ok, this has much more sense now. Then my issue must lie somewhere in my code, i am going to investigate further on this. Thank you very much!

TheGreyGhost commented 4 years ago

no worries, you're welcome!