Jump to content

[1.5.1] Block/Item Texture/Icon location?


Kalbintion

Recommended Posts

I am wondering where (for testing purposes at this moment) the block/item texture/icon location is. Right now I have the custom item images located at "\forge\mcp\jars\mods\%modname%\textures\items\%itemname%.png" and blocks in the same location but "..\blocks\%blockname%.png" but neither are loading and am receiving a "Missing Texture" texture in-game when ran from Eclipse IDE.

 

A generic example Item class I have.

package mod.ModName;

import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;

public class ItemName extends Item {
public ItemName(int id) {
	super(id);
	this.setMaxStackSize(1);
	this.setCreativeTab(CreativeTabs.tabMisc);
	this.setUnlocalizedName("ModNameItemName");
	LanguageRegistry.addName(this, "ItemName");
}

public void updateIcons(IconRegister par1IconRegister) {
	this.iconIndex = par1IconRegister.registerIcon("ModName:ItemName");
}
}

 

With that, I would expect the icon file to be located at "\forge\mcp\jars\mods\ModName\textures\items\ItemName.png"

 

I have followed the basic tutorials on the wiki, and have searched the forums for 1.5+ related questions, what I have found has led me to this point. The wiki tutorial on textures is outdated and was the original stopping point for me since it wasn't working then.

Link to comment
Share on other sites

You placed the files to right folder, but You have to override

updateIcons function.

 

I do mine like so:

 

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister)//updateIcons
{
    iconIndex = iconRegister.registerIcon(SenitielsSpaceMarineMod.ModId+":"+name);
}

 

Where ModId is the name I put in the @Mod attribute in the main class.

 

Remember to put " : " between mod id and item name. Also note, that unlocalizedName has "item_" before what You have assigned (or "tile_" in case of blocks).

Link to comment
Share on other sites

Well, upon doing what was said and some other directory locations (found by searching the forge folder for a "mods" folder) and attempting those locations (see below) I am still receiving a missing textures texture but I have found a warning in the console output saying the file cannot be found and what it was looking for. Following that, I made sure the folder names were properly named according to what it said it couldnt find, and it failed again. So i tried other directories, each time it failing. Just to mention, I am using forge 608 at this time.

 

2013-03-25 12:08:33 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file mods/ModName/textures/items/ItemName.png, but that file does not exist. Ignoring.

 

Current Item Example

package mod.ModName;

import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.*;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;

public class ItemName extends Item {
public ItemName(int id) {
	super(id);
	this.setMaxStackSize(1);
	this.setCreativeTab(CreativeTabs.tabMisc);
	this.setUnlocalizedName("ModNameItemName");
	LanguageRegistry.addName(this, "ItemName");
}

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister par1IconRegister) {
	this.iconIndex = par1IconRegister.registerIcon("ModName:ItemName");
}
}

 

Locations I've Tried putting the folder scheme (\ModName\textures\items\ItemName.png) into (all with failure)

\forge\fml\bin\mods
\forge\fml\client\mods
\forge\fml\common\mods
\forge\mcp\bin\minecraft\mods
\forge\mcp\eclipse\Minecraft\bin\mods
\forge\mcp\mods
\forge\mcp\src\minecraft\mods
\forge\mcp\temp\bin\minecraft\mods
\forge\mcp\temp\cls\minecraft\mods
\forge\mcp\temp\src\minecraft\mods

Link to comment
Share on other sites

I think You didn't understand me correctly. But then, maybe I should have been more specific.

 

put this

 

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister)//updateIcons
{
    iconIndex = iconRegister.registerIcon("ModName"+":"+"ItemName");
}

 

into Your ItemName class, and make all of Your items derive from it.

 

Forge has a feature, that if you call iconRegister.registerIcon(modname+":"+itemname) minecraft will search for the file in

 

"mcp/src/mods/modname/textures/items/itemname.png"

 

 

or, in case of blocks:

 

iconRegister.registerIcon(modname+":"+blockname)

 

"mcp/src/mods/modname/textures/blocks/blockname.png"

 

Code checks itself, if the texture is in blocks or items folder.

 

Does this solve Your problem?

Link to comment
Share on other sites

So if i understand you right I put for example if the mod is called MagicCola and the Item is called Cola :  @SideOnly(Side.CLIENT)

@Override

public void updateIcons(IconRegister iconRegister)//updateIcons

{

    iconIndex = iconRegister.registerIcon("MagicCola"+":"+"Cola");

}

is that right?

Link to comment
Share on other sites

2013-03-28 11:20:13 [WARNING] [Minecraft-Client] TextureManager.createTexture called for file textures/items/item_*modid**itemname*, but that file does not exist. Ignoring.

That is my error, please help. I have tried the texture in %mcp%/src/minecraft/mods/*modid*/textures/items/item_momeatSeasonedBeef.png

%mcp%/src/minecraft/*modid*/textures/items/item_momeatSeasonedBeef.png

%mcp%/src/minecraft/textures/items/item_momeatSeasonedBeef.png

and it still doesn't work. My code is:

package cookie.mods.momeat.items;

import cookie.mods.momeat.CommonProxy;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cookie.mods.momeat.MoMeat;

public class ItemSeasonedBeef extends ItemFood {

public ItemSeasonedBeef(int par1, int par2, boolean par3) {
	super(par1, par2, par3);
	setAlwaysEdible();
}

@SideOnly(Side.CLIENT)
@Override
public void updateIcons(IconRegister iconRegister) {
	iconIndex = iconRegister.registerIcon("momeat" + ":" + this.getUnlocalizedName());
}

}

and I just get a square with "missing texture missing texture" written on it.

Link to comment
Share on other sites

Textures go in:

 

/mcp/src/minecraft/mods/%MODNAME%/textures/%TYPE%/%FILENAME%.png

 

Where %MODNAME% and %FILENAME% are specified in the call to iconRegister.registerIcon(...)

 

e.g. for an item,

iconRegister.registerIcon("MyMod:MyItem")

 

will look for a texture at:

/mcp/src/minecraft/mods/MyMod/textures/items/MyItem.png

 

for a block, it will look in ...textures/blocks/ instead of ...textures/items/

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

Textures go in:

 

/mcp/src/minecraft/mods/%MODNAME%/textures/%TYPE%/%FILENAME%.png

 

Where %MODNAME% and %FILENAME% are specified in the call to iconRegister.registerIcon(...)

 

e.g. for an item,

iconRegister.registerIcon("MyMod:MyItem")

 

will look for a texture at:

/mcp/src/minecraft/mods/MyMod/textures/items/MyItem.png

 

for a block, it will look in ...textures/blocks/ instead of ...textures/items/

 

 

He's right, this is what I use and it works perfectly. In the .class fine your using for the item/items you place

@Override

public void updateIcons(IconRegister iconRegister)

{

iconIndex = iconRegister.registerIcon("mps:energyCore");

        }

 

Where mps is the mod name and energyCore is the file name, so the item picture would be in MCP/src/minecraft/mods/mps/textures/items/energyCore.png

Make sure to not put .png at the end of the file name in Eclipse.

I am the current head modder for the Metroid Prime Suits mod. I have no other staff members, so I'm hiring! I also co-own the SkyTekkit server.

width=600 height=126http://i1276.photobucket.com/albums/y480/Sypher40/MPSbanner_zps9d50d86a.png[/img]

Link to comment
Share on other sites

I did what you said, but I just got an NPE.

 

 

2013-03-28 14:49:51 [iNFO] [sTDERR] java.lang.RuntimeException: Don't register null!

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.renderer.texture.TextureMap.registerIcon(TextureMap.java:229)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.item.Item.updateIcons(Item.java:726)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:85)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:521)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:440)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729)

2013-03-28 14:49:51 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)

2013-03-28 14:49:51 [iNFO] [sTDERR] java.lang.NullPointerException

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:102)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:521)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:440)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

2013-03-28 14:49:51 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:729)

2013-03-28 14:49:51 [iNFO] [sTDERR] at java.lang.Thread.run(Unknown Source)

 

 

EDIT: Ok, I've just found out from the code that it throws that NPE when registerIcon() gets passed null, but I think I've written updateIcons() right.

@Override
@SideOnly(Side.CLIENT)
public void updateIcons(IconRegister iconRegister) {
	iconIndex = iconRegister.registerIcon("momeat" + ":" + "SeasonedBeef");
}

Link to comment
Share on other sites

  • 1 month later...

this is what got it to work for me

 

       

        @Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconRegister) {
        this.itemIcon = iconRegister.registerIcon("modname:itemname");

Link to comment
Share on other sites

Also, try putting a file system like this:

 

/mods/%MODID%/textures/(items or blocks depending)/%FILENAME%.png

 

into mcp/eclipse/bin/

 

That is where I put my textures whilst developing mods

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Hey guys, I am learning to mod so I am doing my first testing mod in 1.5 (already have made one testing mod in 1.4.7) and I have the same problem with the textures (error with missing texture) and I tried everything I found on the internet and it still does not work.

 

So here is my code for my blocks and items:

 

 

For blocks:

package first.Block;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ModBlock extends Block {

    private String location;

    public ModBlock(int id, Material material, String location) {
        super(id, material);

        this.location = location;

    }

    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1iconRegister) {
        this.blockIcon = par1iconRegister.registerIcon("first:" + location);

    }

}

And for Items:

package first.Item;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;

public class ModItem extends Item{
    
    private String location;

    public ModItem(int par1, String location) {
        super(par1);
        this.location = location;
    }
    
    @SideOnly(Side.CLIENT)
    @Override
    public void registerIcons(IconRegister par1IconRegister){
        this.itemIcon = par1IconRegister.registerIcon("first:" + location);
    }


}

 

 

And I have the textures at:

mcp\src\minecraft\mods\first\textures\blocks\

mcp\src\minecraft\mods\first\textures\items\

 

and I am sure that the names are correct.

 

Please help, I am really stuck on that :(

If someone helps you, click that thank you button ;)

 

EasyTessellator library: http://www.minecraftforge.net/forum/index.php/topic,14705.0.html

Link to comment
Share on other sites

And for the tenth time...

 

Capture.png

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

  • 2 weeks later...

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
    • OLXTOTO adalah situs bandar togel online resmi terbesar dan terpercaya di Indonesia. Bergabunglah dengan OLXTOTO dan nikmati pengalaman bermain togel yang aman dan terjamin. Koleksi toto 4D dan togel toto terlengkap di OLXTOTO membuat para member memiliki pilihan taruhan yang lebih banyak. Sebagai situs togel terpercaya, OLXTOTO menjaga keamanan dan kenyamanan para membernya dengan sistem keamanan terbaik dan enkripsi data. Transaksi yang cepat, aman, dan terpercaya merupakan jaminan dari OLXTOTO. Nikmati layanan situs toto terbaik dari OLXTOTO dengan tampilan yang user-friendly dan mudah digunakan. Layanan pelanggan tersedia 24/7 untuk membantu para member. Bergabunglah dengan OLXTOTO sekarang untuk merasakan pengalaman bermain togel yang menyenangkan dan menguntungkan.
    • Baba  Serege [[+27-73 590 8989]] has experience of 27 years in helping and guiding many people from all over the world. His psychic abilities may help you answer and resolve many unanswered questions. He specialize in helping women and men from all walks of life.. 1) – Bring back lost lover. even if lost for a long time. 2) – My lover is abusing alcohol, partying and cheating on me I urgently need help” 3) – Divorce or court issues. 4) – Is your love falling apart? 5) – Do you want your love to grow stronger? 6) – Is your partner losing interest in you? 7) – Do you want to catch your partner cheating on you? – We help to keep your partner faithful and loyal to you. 9) – We recover love and happiness when relationship breaks down. 10) – Making your partner loves you alone. 11) – We create loyalty and everlasting love between couples. 12) – Get a divorce settlement quickly from your ex-partner. 13) – We create everlasting love between couples. 14) – We help you look for the best suitable partner. 15) – We bring back lost lover even if lost for a long time. 16) – We strengthen bonds in all love relationship and marriages 17) – Are you an herbalist who wants to get more powers? 18) – Buy a house or car of your dream. 19) – Unfinished jobs by other doctors come to me. 20) – I help those seeking employment. 21) – Pensioners free treatment. 22) – Win business tenders and contracts. 23) – Do you need to recover your lost property? 24) – Promotion at work and better pay. 25) – Do you want to be protected from bad spirits and nightmares? 26) – Financial problems. 27) – Why you can’t keep money or lovers? 28) – Why you have a lot of enemies? 29) – Why you are fired regularly on jobs? 30) – Speed up money claim spell, delayed payments, pension and accident funds 31) – I help students pass their exams/interviews. 33) – Removal of bad luck and debts. 34) – Are struggling to sleep because of a spiritual wife or husband. 35- ) Recover stolen property
    • BD303 merupakan salah satu situs slot mudah scatter paling populer dan digemari oleh kalangan slot online di tahun 2024 mainkan sekarang dengan kesempatan yang mudah menang jackpot jutaan rupiah.
  • Topics

×
×
  • Create New...

Important Information

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