Jump to content

[SOLVED]Textures not loading IN Minecraft (they do in Eclipse)


AndrewSherman

Recommended Posts

SOLVED: The directory for resources is minecraft/mods/[YOURMOD.zip]/mods/resources/textures/blocks/.png. Rather than just .minecraft/mods/resources/textures/blocks/.png/

 

MCP 751

I'm on a mac (not by free choice though :P )

 

Ok so here's the deal. I only found out yesterday that the whole Item/Block texture system has completely changed from what it was when I was last modding (around January 2013). So I hastily looked up how to do it. An example of my code is here:

width=800 height=453http://i1227.photobucket.com/albums/ee437/AndrewShermans/Screenshot2013-06-13at120046_zps074f2109.png[/img]

Now this works fine in Eclipse, with the directory for the image files as [mcp751]/src/minecraft/mods/GraveyardResources/textures/blocksORitems/icon.png

 

But as soon as I put my mod folder into minecraft.jar (after reobfuscating obviously), the mod works fine but all of the textures have the mysterious white texture which says 'Missing Texture'( or whatever).

 

This is the directory of my resources folder:

width=800 height=472http://i1227.photobucket.com/albums/ee437/AndrewShermans/Screenshot2013-06-13at115941_zps80fd819c.png[/img]

 

Anyone know what the problem is? Either code or directories, I'm open to suggestions!

 

PS: Could it be something to do with the Mac?

Link to comment
Share on other sites

You have missed the this. from the front of your code... Simple mistake :P

 

Here is an example :)

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister iconRegister){

this.itemIcon = iconRegister.registerIcon("<mod folder>:<file name, without.png>");

}

 

 

Why bother?

Link to comment
Share on other sites

You have missed the this. from the front of your code... Simple mistake :P

 

No he didn't, check the screenshots again.

 

Andrew:

Did you add your textures to your reobfuscated zip?  The recompiler/reobfuscator doesn't pull textures in.

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

No, the reobfuscated file was my Graveyards_Mod folder, which contains all of the .class files.

 

I simply copied the GraveyardResources folder from where I had it in the MCP/src/mod/...etc into the directory in the picture!

 

 

EDIT: Sorry for the late reply, I'm surprised at the quick responses! PS: What time zone are the majority of people here on? I'm in the UK so it's now 13:19

Link to comment
Share on other sites

Whoah there!

 

When I reobfuscate I get this [MCP]/reobf/minecraft/Graveyards_Mod/**list of class files**

 

Because I made my own package for my mod, I just copy the Graveyards_Mod folder into minecraft.jar for it to work right? Not zipped or anything, just the folder with the compiled class files inside.

 

The resources I took the folder inside the mods folder in eclipse (which is called GraveyardResources) and I put it in the directory shown in the image.

Link to comment
Share on other sites

you need to include mods. in the zipped package (so it'd be mods.Graveyards_Mod.blocks.texture.png for example)

 

like this

2tMHlR6.png

 

 

 

You have missed the this. from the front of your code... Simple mistake :P

 

Here is an example :)

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister iconRegister){

this.itemIcon = iconRegister.registerIcon("<mod folder>:<file name, without.png>");

}

 

umm... i'm not sure what to say? did you learn java? the this. ensures that the variable being referenced is the one local to the class/object, it exists so we can do things like:

public class Foo
{
    public int bar = 0;

    public void setBar(int bar)
    {
        this.bar = bar;
    }

    //Alternatively you could do
    public void setBar(int b)
    {
        bar = b;
    }
}

 

the use if it is only required when there is a variable in the method with the same name, and is sometimes used outside this condition to clarify that this parameter belongs to this object, not just the method. the lack of a this. in the case you are showing wouldn't even matter and, if it did cause a problem, it would be visible inside eclipse.

Link to comment
Share on other sites

Ok, so I zipped together the two folders: Graveyard_Mod (which contains the .class files) and the mods folder (containing GraveyardResources/textures/blocks/xyz.png).

 

And I got the same result as last time.

 

No textures.

 

 

Ok, here is my mod file! I know it's a big ask, but could you please check the files and set up? (try installing it normally first then check the source, as it could just be my computer somehow)

 

Excuse the abismal coding :P

 

http://www.mediafire.com/?41prnkr12ir77m7

Link to comment
Share on other sites

Ok, so I zipped together the two folders: Graveyard_Mod (which contains the .class files) and the mods folder (containing GraveyardResources/textures/blocks/xyz.png).

 

And I got the same result as last time.

 

No textures.

 

 

Ok, here is my mod file! I know it's a big ask, but could you please check the files and set up? (try installing it normally first then check the source, as it could just be my computer somehow)

 

Excuse the abismal coding :P

 

http://www.mediafire.com/?41prnkr12ir77m7

I didn't even need to see the coding, abyssmal or not. Replace "GraveyardResources/" with "mods/GraveyardResources/".

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Link to comment
Share on other sites

Haha, wow I'm an idiot apparently.

 

BTW I think it should be made clearer that the mods folder that you put your resources in is inside the .zip file rather than just putting the resources folder in the actual mods folder (.minecraft/mods).

Exactly. I think, Draco, that this should be put in our EAQ as well.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

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.