Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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

  • Author

Here is my sprite sheet:OxH0C.png

And I'm using the current version of Forge, which is Forge 4.0.0 Minecraft 1.3.2

And how do you set up the index?

 

-.-

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

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 :)

build #400

 

what is the last number in the forge zip you downloaded, I.E, 4.0.0.217    thats the version i'm using untill later

1 word,

 

update

 

 

also in your mod_ file you preload the items.png but in your item file you use item.png

 

you either missed the 's' in the item or you added an 's' when you preloaded it

  • Author

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

 

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.