Jump to content

[1.3.2] getTextureFile() help for replacement of ITextureProvider


thepowdertoy

Recommended Posts

I'm still a noob coder, and currently I'm following this guide for adding infinite terrain and item indexes:

 

http://www.minecraftforge.net/wiki/How_to_use_infinite_terrain_and_sprite_indexes

 

but it uses the ITextureProvider, which in the current Forge version doesn't exist. So, after searching in the forum, nearly everything say use this to replace ITextureProvider:

 

public String getTextureFile(){
return "[Terrain File]";
}

 

but I don't know where to put the code. Here is my mod_tutorial:

package net.minecraft.src;

import net.minecraftforge.client.MinecraftForgeClient;

public class mod_tutorial extends BaseMod
{

public static Item TutorialIngot;



public static final Block TutorialBlock ;

static
{

	TutorialBlock = (new BlockTutorialBlock(255, ModLoader.addOverride("/terrain.png", "/mods/tes1.png"))).setHardness(3F).setResistance(5F).setStepSound(Block.soundWoodFootstep).setBlockName("First Block");
	TutorialIngot = (new Item(1000)).setIconIndex(0).setItemName("TutorialIngot").
}

   

        public void load()
        {
                
        }

        public mod_tutorial()
        {
        	MinecraftForgeClient.preloadTexture("/mods/items.png");
        	ModLoader.addName(TutorialIngot, "Tutorial Ingot");
        	
        	ModLoader.registerBlock(TutorialBlock);
        	ModLoader.addName(TutorialBlock, "Tutorial Block Ore");
        	
        	ModLoader.addSmelting(Block.planks.blockID, new ItemStack(TutorialBlock ,1));
        	ModLoader.addSmelting(TutorialBlock.blockID, new ItemStack(TutorialIngot ,1));
        	
        	 
        }
       
        public String getVersion()
        {
                return "1.0.0";
        }
}

 

And here is my TutorialIngot:

package net.minecraft.src;


public class TutorialIngot extends Item 


{
        public TutorialIngot(int i)
        {
                super(i);
        }

        public String getTextureFile(){
        	  return "/mods/item.png";
        	 }

}

 

But when I run Minecraft, what should the tutorial ingot look like an ingot, it instead look like a leather helmet. Here is the picture:tPGla.png

Link to comment
Share on other sites

Just use getTextureFile if you're not doing anything extra -.-

Also dont know what version of forge you're using but you should always update to the latest build.

Also, make sure you're setting the index properly with your texture sheet, you didnt show what your sheet should look like.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

-.-

4.0.0 tells me NOTHING about the version you are using you can be using build 172 or build 224, build numbers are freaking important.

So I say again UPDATE YOUR FORGE

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

build #400

 

now its included in Item.java or Block.java.

the only problem, is your using 'return "/mods/item.png";' your returning only the ingot.

you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex.

 

I hope I helped you :)

Link to comment
Share on other sites

build #400

 

now its included in Item.java or Block.java.

the only problem, is your using 'return "/mods/item.png";' your returning only the ingot.

you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex.

 

I hope I helped you :)

 

terrain like terrain.png............. Do you mean this:

Dvt15.png

 

or this:

LaOhU.png ?

 

And I already try this too:

j6yhe.png

 

but the ingot is invisible, and I'm using iconIndex 102, which is the place of the ingot

 

Link to comment
Share on other sites

build #400

 

now its included in Item.java or Block.java.

the only problem, is your using 'return "/mods/item.png";' your returning only the ingot.

you need a terrain like 'terrain.png' in minecraft.jar, and then add the item overthere. look up the iconIndex (start counting from zero to 256) untill you hit the item, and the number is your iconIndex.

 

I hope I helped you :)

 

terrain like terrain.png............. Do you mean this:

Dvt15.png

 

or this:

LaOhU.png ?

 

And I already try this too:

j6yhe.png

 

but the ingot is invisible, and I'm using iconIndex 102, which is the place of the ingot

instaed of setIconIndex use setIconCoord(7, 6) for the above items.png

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.



×
×
  • Create New...

Important Information

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