package net.minecraft.src;
import java.util.Random;
public class TinPlate extends Block
{
protected TinPlate(int par1, int par2)
{
super(par1, Material.circuits);
blockIndexInTexture = par2;
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
}
public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3)
{
int i = par0World.getBlockId(par1, par2, par3);
return i == mod_Extracraft.TinPlate.blockID;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i)
{
return null;
}
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3D par5Vec3D, Vec3D par6Vec3D)
{
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3D, par6Vec3D);
}
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
int i = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
if (i >= 2 && i <= 5)
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
}
else
{
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
}
}
public int getBlockTextureFromSideAndMetadata(int par1, int par2)
{
return blockIndexInTexture;
}
public int getRenderType()
{
return mod_Extracraft.TinPlateRenderID;
}
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
return par1World.isBlockNormalCube(par2, par3 - 1, par4);
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
refreshTrackShape(par1World, par2, par3, par4, true);
}
}
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (par1World.isRemote)
{
return;
}
int i = par1World.getBlockMetadata(par2, par3, par4);
int j = i;
boolean flag = false;
if (!par1World.isBlockNormalCube(par2, par3 - 1, par4))
{
flag = true;
}
if (j == 2 && !par1World.isBlockNormalCube(par2 + 1, par3, par4))
{
flag = true;
}
if (j == 3 && !par1World.isBlockNormalCube(par2 - 1, par3, par4))
{
flag = true;
}
if (j == 4 && !par1World.isBlockNormalCube(par2, par3, par4 - 1))
{
flag = true;
}
if (j == 5 && !par1World.isBlockNormalCube(par2, par3, par4 + 1))
{
flag = true;
}
if (flag)
{
dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
private void refreshTrackShape(World par1World, int par2, int par3, int par4, boolean par5)
{
if (par1World.isRemote)
{
return;
}
else
{
(new PlateLogic(this, par1World, par2, par3, par4)).refreshTrackShape(par1World.isBlockIndirectlyGettingPowered(par2, par3, par4), par5);
return;
}
}
}
I am running error free. I thank those in advance who can help me. Please Help!
because ModLoader changed to suit the camelCase convention.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Heres the rendering portion of the mod_ file. I think the rest of the code is irrelevant, but if you need it I will give it to you.
Heres my TinPlate File:
I am running error free. I thank those in advance who can help me. Please Help!
because ModLoader changed to suit the camelCase convention.
together they are powerful beyond imagination."
This is the renderWorldBlock function in BaseMod. If you are to override it, you need to have the same parameter types.