Please help since nobody helped in all my other posts but i helped them.
Mod class:
package net.minecraft.src;
public class mod_GameBlock extends BaseMod{
public static void addGame(BiomeGenBase biome) {
if(biome != null) {
System.out.println("Added game " + biome);
}
}
public static final Block Namehere = new BlockGame(174, 0).setBlockName("anynamehere").setHardness(3F).setResistance(4F).setLightValue(1F);
public static int NamehereBottom = ModLoader.addOverride("/terrain.png", "/gameblock/Bottom.png");
public static int NamehereTop = ModLoader.addOverride("/terrain.png", "/gameblock/GameBlockTop.png");
public static int NamehereSides = ModLoader.addOverride("/terrain.png", "/gameblock/GameBlockSide.png");
public static int NamehereFront = ModLoader.addOverride("/terrain.png", "/gameblock/GameBlockBack.png");
public String getVersion() {
return "1.2.3";
}
public void load()
{
//Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/gameblock/GameBlockBack.png");
ModLoader.registerBlock(Namehere);
ModLoader.addName(Namehere, "GameBlock Console");
ModLoader.addRecipe(new ItemStack(Namehere, 1), new Object [] {"#", Character.valueOf('#'), Block.dirt});
}
}
Block Class:
package net.minecraft.src;
import java.awt.Color;
import java.util.ArrayList;
import java.util.Random;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.Minecraft;
public class BlockGame extends Block
{
protected BlockGame(int i, int j)
{
super(i, j, Material.iron);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
setLightOpacity(255);
}
public boolean isOpaqueCube()
{
return false;
}
public int idDropped(int i, Random random, int j)
{
return mod_GameBlock.Namehere.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if (this != Block.stairSingle)
{
super.shouldSideBeRendered(iblockaccess, i, j, k, l);
}
if (l == 1)
{
return true;
}
if (!super.shouldSideBeRendered(iblockaccess, i, j, k, l))
{
return false;
}
if (l == 0)
{
return true;
}
else
{
return iblockaccess.getBlockId(i, j, k) != blockID;
}
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
return getBlockTextureFromSide(i);
}
public int getBlockTextureFromSide(int i)
{
if (i == 0)
{
return mod_GameBlock.NamehereBottom;
}
if (i == 1)
{
return mod_GameBlock.NamehereTop;
}
if (i == 2)
{
return mod_GameBlock.NamehereFront;
}
else
{
return mod_GameBlock.NamehereSides;
}
}
}
How can I make the texture front face your character when you place it?
I tried getting the players F position then doing if(i == posF) return whatever; but it didn't work.
Mod class:
Block Class:
How can I make the texture front face your character when you place it?
I tried getting the players F position then doing if(i == posF) return whatever; but it didn't work.
I tried that on a half slab and the textures got messed up