Jump to content

[1.10.2] Texture/model not working properly?


AnZaNaMa

Recommended Posts

So, i've gone and made my first item and I go in game to look at it and it's got the black and purple missing texture. There are no errors in log regarding it so I'm not sure what I've done wrong. The item is called aether_star (unlocalized and registry name), the modid is "everythinginbetween" and the texture is in "src/main/resources/assets/everythinginbetween/textures/items/aether_star.png"

 

I've used ModelLoader#setCustomModelResourceLocation() to register the model and there is a model in "models/item/aether_star.json"

 

Here is a link to the log: http://pastebin.com/rsk81Hzx

The Item Class: https://github.com/AnZaNaMa/EverythingInBetween/blob/master/src/main/java/com/anzanama/everythinginbetween/common/item/ItemAetherStar.java

The ModItems Class (with ModelLoader method): https://github.com/AnZaNaMa/EverythingInBetween/blob/master/src/main/java/com/anzanama/everythinginbetween/common/item/ItemsEIB.java

The Main Class: https://github.com/AnZaNaMa/EverythingInBetween/blob/master/src/main/java/com/anzanama/everythinginbetween/EverythingInBetween.java

The Client Proxy Class: https://github.com/AnZaNaMa/EverythingInBetween/blob/master/src/main/java/com/anzanama/everythinginbetween/client/EIBClientProxy.java

- Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.

Link to comment
Share on other sites

You need to have it use your modid as well. For example:

ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("everythinginbetween:"+item.getRegistryName(), "inventory"));

If that doesn't work, try the following code instead(this is how I register mine, so I know this method works):

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("everythinginbetween:" + item.getRegistryName(), "inventory"));

If I helped please press the Thank You button.

 

Check out my mods at http://www.curse.com/users/The_Fireplace/projects

Link to comment
Share on other sites

You need to have it use your modid as well. For example:

ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation("everythinginbetween:"+item.getRegistryName(), "inventory"));

If that doesn't work, try the following code instead(this is how I register mine, so I know this method works):

Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("everythinginbetween:" + item.getRegistryName(), "inventory"));

Ö.ö??

/**

    * Sets a unique name for this Item. This should be used for uniquely identify the instance of the Item.

    * This is the valid replacement for the atrocious 'getUnlocalizedName().substring(6)' stuff that everyone does.

    * Unlocalized names have NOTHING to do with unique identifiers. As demonstrated by vanilla blocks and items.

    *

    * The supplied name will be prefixed with the currently active mod's modId.

    * If the supplied name already has a prefix that is different, it will be used and a warning will be logged.

 

Also, Minecraft.getMinecraft().getRenderItem().getItemModelMesher() is prone to soooooooo many issues, that stating that it "works" 100% of the time cannot ever be true. Forge had to add it's own ModelLoader, just to fix the issues getItemModelMesher have!

 

@AnZaNaMa

ModelLoader has to be called in preInit. You are calling it in init.

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Also there is no need to preface getRegistryName with your mod ID because getRegistryName already does that.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Also there is no need to preface getRegistryName with your mod ID because getRegistryName already does that.

Thats... kinda what I just said. Read the highlighted part of the quote  ;)

Also previously known as eAndPi.

"Pi, is there a station coming up where we can board your train of thought?" -Kronnn

Published Mods: Underworld

Handy links: Vic_'s Forge events Own WIP Tutorials.

Link to comment
Share on other sites

Sorry, somehow missed that

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Okay cool. Thanks everyone! I knew the itemModelMesher one was bad to use so thanks

- Just because things are the way they are doesn't mean they can't be the way you want them to be. Unless they're aspen trees. You can tell they're aspens 'cause the way they are.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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