Im probably missing something very simple, but i cant figure out what it is, i have a Custom furnace, called an Icebox, and the way i have the code, the Icebox texture is either always on or always off, even if its Active. here is my code for the textures,
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 1)
{
return mod_Cool.IceboxTop;
}
if(l == 0)
{
return mod_Cool.IceboxSide;
}
int i1 = iblockaccess.getBlockMetadata(i, j, k);
if(l != i1)
{
return mod_Cool.IceboxSide;
}
if(isActive)
{
return mod_Cool.IceboxOff;
} else
{
return mod_Cool.IceboxOn2;
}
}
public void randomDisplayTick(World world, int i, int j, int k, Random random)
{
if(!isActive)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
float f = (float)i + 0.5F;
float f1 = (float)j + 0.0F + (random.nextFloat() * 6F) / 16F;
float f2 = (float)k + 0.5F;
float f3 = 0.52F;
float f4 = random.nextFloat() * 0.6F - 0.3F;
if(l == 4)
{
world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 5)
{
world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else
if(l == 2)
{
world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} else
if(l == 3)
{
world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
public int getBlockTextureFromSide(int i)
{
if(i == 1)
{
return mod_Cool.IceboxTop;
}
if(i == 0)
{
return mod_Cool.IceboxSide;
}
if(i == 3)
{
return mod_Cool.IceboxOff;
} else
{
return mod_Cool.IceboxOn2;
}
}
sorry that it wasnt in a Spoiler, and ignore the particles part. the textures are pretty self explainitory. help?
especially the last if statement, it returns IceboxOff if the side is 3, if not, it returns IceboxOn2. Doubt you meant to do that. It basically makes the previous 2 if statements useless as they get overwritten.
You might want to read that again, return immediately stops the function and returns the value, if either of the first two are true the third if will never run.
sorry that it wasnt in a Spoiler, and ignore the particles part. the textures are pretty self explainitory. help?
You might want to read that again, return immediately stops the function and returns the value, if either of the first two are true the third if will never run.
To the OP:
try