Ok, but when its ones activated then stays in that texture .. For testing i putted 3 various textures. Here is the code :
package net.rufus.mb.blocks;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockRedstoneLight;
import net.minecraft.init.Blocks;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.rufus.mb.MainClass;
public class GreenLamp extends BlockRedstoneLight {
private boolean field_150171_a;
public GreenLamp(boolean p_i45421_1_) {
super(p_i45421_1_);
setCreativeTab(MainClass.MoreBlocks);
setBlockName("GreenLamp");
setBlockTextureName(MainClass.modid + ":GreenLampIdle");
}
public void onBlockAdded(World p_149726_1_, int p_149726_2_, int p_149726_3_, int p_149726_4_)
{
if (!p_149726_1_.isRemote)
{
if (this.field_150171_a && !p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_))
{
p_149726_1_.scheduleBlockUpdate(p_149726_2_, p_149726_3_, p_149726_4_, this, 4);
}
else if (!this.field_150171_a && p_149726_1_.isBlockIndirectlyGettingPowered(p_149726_2_, p_149726_3_, p_149726_4_))
{
p_149726_1_.setBlock(p_149726_2_, p_149726_3_, p_149726_4_, MainClass.BlueBrick, 0, 2);
}
}
}
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
{
if (!p_149695_1_.isRemote)
{
if (this.field_150171_a && !p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_))
{
p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, 4);
}
else if (!this.field_150171_a && p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_))
{
p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, MainClass.RedBrick, 0, 2);
}
}
}
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
{
if (!p_149674_1_.isRemote && this.field_150171_a && !p_149674_1_.isBlockIndirectlyGettingPowered(p_149674_2_, p_149674_3_, p_149674_4_))
{
p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, MainClass.GreenLamp, 0, 2);
}
}
}