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

Hello,

I was trying to use infinite terrain and sprite indexes for an item. However, it would not work\. It just showed a white square with a black dot. In older versions, you impliment ItextureProvider. I was wondering what the equivlent was for 1.3.2. I have attached my code.

 

capsuels.java

package mrkirby153.capsuels;

import java.io.File;

import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.ItemStack;
import net.minecraft.src.ModLoader;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.Configuration;

import cpw.mods.fml.common.*;
import cpw.mods.fml.common.Mod.Item;
import cpw.mods.fml.common.Mod.*;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid= "Capsuels Mod", name = "Capsuels Mod", version = "Alpha 0.1")
public class Capsuels {


@Init
public void load(FMLInitializationEvent event){
	File file = new File(Minecraft.getMinecraftDir(), "/config/Capsuels.cfg");

	Configuration cfg = new Configuration(file);
	cfg.load();

	int EmptyID = cfg.getOrCreateBlockIdProperty("Empty Capsuels", 500).getInt();
	int EXPID = cfg.getOrCreateBlockIdProperty("EXP Capsuels", 501).getInt();

	final net.minecraft.src.Item emptyCap= (new ItemEmptyCap(EmptyID)).setFull3D().setIconCoord(0, 0).setItemName("ItemEmptyCap");
	final net.minecraft.src.Item capEXP;
	MinecraftForgeClient.preloadTexture("/mrkirby153/Capsuels/Capsuels.png");
	LanguageRegistry.addName(emptyCap, "Empty Cap");
	GameRegistry.addShapelessRecipe(new ItemStack(emptyCap, 1), new Object[] {Block.dirt});

}
}

 

ItemEmptyCap.java

package mrkirby153.capsuels;

import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EnumAction;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.World;

public class ItemEmptyCap extends Item {
public ItemEmptyCap (int par1){
	super(par1);
	this.setMaxStackSize(3);
}

public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
	--par1ItemStack.stackSize;
	if(!par2World.isRemote){
		par3EntityPlayer.clearActivePotions();
	}
	return par1ItemStack;
}

public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
	return 32;
}

public EnumAction getItemUseAction(ItemStack par1ItemStack){
	return EnumAction.drink;
}

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EnttyPlayer){
	par3EnttyPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack));
	return par1ItemStack;
}

public String getTextureFile(){
	return "/mrkirby153/Capsuels/Capsuels.png";
}



}

From what you've said I'm assuming you're testing from eclipse, therefore I guess your problem is that you haven't added your images. go to your jars file in mcp, then bin and open minecraft.jar from there add your images to the directory defined in the main class.

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.