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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Add the crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here  
    • Add the ful lcrash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here
    • I cant craft any of the epic fight mod weapons. I try using the recipes in the crafting table but nothing is working. and when i click on the epic fight weapon in jei there is no recipe at all.
    • Hello All! Started a MC Eternal 1.6.2.2 server on Shockbyte hosting. The only other mod I added was betterfarmland v0.0.8BETA. Server is 16GB and Shockbyte wont tell me how many CPU cores i have.  We are having problems now when players log in it seems to crash the server. At other times it seems fine and we can have 3 people playing for hours at a time. Usually always when it does crash it is when someone logs in. Crash Reports Below. To the person who can post the fix I will reward $100 via Paypal.   ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 2024-09-19 21:04:58 UTC Description: Exception in server tick loop java.lang.StackOverflowError     at net.minecraft.advancements.PlayerAdvancements.hasCompletedChildrenOrSelf(PlayerAdvancements.java:451)     at net.minecraft.advancements.PlayerAdvancements.shouldBeVisible(PlayerAdvancements.java:419)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:385)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:406)     at net.minecraft.advancements.PlayerAdvancements.ensureVisibility(PlayerAdvancements.java:411)     at net.minecraft.advancements.P  
  • Topics

×
×
  • Create New...

Important Information

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