There is actually two problems: the first is that the top/bottom of one of my textures isn't working, and the other problem is the icons in containers of my blocks show up wrong. Here is a screenshot to better explain my problem:
You can see that the bottom texture of the hay/crate block looks fine, and so does the top. But the top and bottoms of the hay is broken, and so are the icons.
Here is the block code for the hay:
package net.minecraft.src;
import java.util.Random;
public class BlockvbHay extends Block
{
protected BlockvbHay(int i, int j)
{
super(i, j, Material.cloth);
blockIndexInTexture2 = 0;
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if (i == 0 || i == 1)
{
return blockIndexInTexture2;
}
if (i >= 2)
{
return blockIndexInTexture;
}
return 0;
}
public static int blockIndexInTexture2;
//--drop 9 wheatsicles.
public int idDropped(int i, Random random)
{
return Item.wheat.shiftedIndex;
}
public int quantityDropped(Random random)
{
return 9;
}
}
Here is the code for the mod:
package net.minecraft.src;
import java.util.Random;
//-- VillageBlox v0.1 by cecil howe
//-- you can do with you want with the code, but if you repackage
//-- this mod as your own, use your own textures. you don't even
//-- have to credit me, because thats dumb and this is the internet.
//-- License: All code is Public Domain, images belong to Cecil Howe
public class mod_VillageBlox extends BaseMod
{
//add yer damn blocks here
//make sure Block block = Block
public static final Block blockvbHay = new BlockvbHay(255, 0).setHardness(1.3F).setResistance(1.0F).setBlockName("blockvbHay").setStepSound(Block.soundGrassFootstep);
public static final Block blockvbSCrate = new BlockvbSCrate(254, 0).setHardness(3.9F).setResistance(2.0F).setBlockName("blockvbSCrate").setStepSound(Block.soundWoodFootstep);
public static final Block blockvbHCrate = new BlockvbHCrate(253, 0).setHardness(3.0F).setResistance(1.5F).setBlockName("blockvbHCrate").setStepSound(Block.soundWoodFootstep);
public mod_VillageBlox()
{
//--HAY BALE
ModLoader.RegisterBlock(blockvbHay);
ModLoader.AddName(blockvbHay, "Hay Bale");
blockvbHay.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHaySide.png");
BlockvbHay.blockIndexInTexture2 = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHayTop.png");
ModLoader.AddRecipe(new ItemStack(blockvbHay, 1), new Object[] { "XXX", "XXX", "XXX", Character.valueOf('X'), Item.wheat });
//--SEALED CRATE
ModLoader.RegisterBlock(blockvbSCrate);
ModLoader.AddName(blockvbSCrate, "Sealed Crate");
blockvbSCrate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbScrate.png");
ModLoader.AddRecipe(new ItemStack(blockvbSCrate, 1), new Object[] { " O ", "OOO", " O ", Character.valueOf('O'), Block.planks });
//--HAY CRATE
ModLoader.RegisterBlock(blockvbHCrate);
ModLoader.AddName(blockvbHCrate, "Box of Hay");
blockvbHCrate.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHCrateSide.png");
BlockvbHCrate.blockIndexInTexture2 = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbSCrate.png");
BlockvbHCrate.blockIndexInTexture3 = ModLoader.addOverride("/terrain.png", "/VillageBlox/vbHayTop.png");
ModLoader.AddRecipe(new ItemStack(blockvbHCrate, 1), new Object[] { "oo ", "jj ", Character.valueOf('o'), Item.wheat, Character.valueOf('j'), Block.planks });
//--SUPPORT BEAM
}
public String Version()
{
return "VillageBlox 0.1";
}
}
At the moment I believe the problem is that your trying to override the texture with 2 textures. You might want to use for defining your multiple textures.
public static int NameOfTexture = ModLoader.addOverride("/terrain.png", "/FolderLoction/FileName.png");
Then change
return blockIndexInTexture;
to
return mod_XXX.NameOfTexture;
I hope this helps. (I'm not the best at explaining things)
I will try that, but I will say that I use the crate texture twice too, and it works no problem.
You can see that the bottom texture of the hay/crate block looks fine, and so does the top. But the top and bottoms of the hay is broken, and so are the icons.
Here is the block code for the hay:
Here is the code for the mod:
Any insight?
I will try that, but I will say that I use the crate texture twice too, and it works no problem.