Jump to content

Infinite terain and sprite indexes 1.3.2


mrkirby153

Recommended Posts

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";
}



}

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



×
×
  • Create New...

Important Information

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