When creating a mod compatible with Modloader, what code do I use to make my mod take Block and Item icons from specific .pngs made for that item instead of looking towards items.png and terrain.png of whatever texture pack you have installed? (See Roundabout's Foodblocks and Shockah's Mineral mods for what I'm talking about)
This post was originally an agreement with the OP, but since I'm currently looking through the decompiled code for a mod that apparently does/did this, I think I know how to do this now.
The following code is from the Functional Bookshelves mod's mod_FunctionalBooks.java (which is outdated, but I'm guessing this portion of the code should still be applicable, right?).
The code for BlockBookshelf then proceeds to use that shelfTex[0] just like a normal texture index.
The following code is from an edited version of Functional Bookshelves' BlockBookshelf.java.
public int getBlockTextureFromSide(int i)
{
// If the side given is the top or bottom, then use the regular wood texture.
if (i <= 1)
{
return 4;
}
// Otherwise, use the empty bookshelf texture.
else
{
return mod_FunctionalBooks.shelfTex[0];
}
}
Like I mentioned before, he's now using mod_FunctionalBooks.shelfTex[0] just like a normal texture index.
I hope this is useful, and good luck with your mods!
The following code is from the Functional Bookshelves mod's mod_FunctionalBooks.java (which is outdated, but I'm guessing this portion of the code should still be applicable, right?).
The code for BlockBookshelf then proceeds to use that shelfTex[0] just like a normal texture index.
The following code is from an edited version of Functional Bookshelves' BlockBookshelf.java.
Like I mentioned before, he's now using mod_FunctionalBooks.shelfTex[0] just like a normal texture index.
I hope this is useful, and good luck with your mods!