Chaîne de redstone

XDki113r

Moddeur sur MacBook Pro
23 Septembre 2011
172
12
13
26
Québec, Canada
Bonjour,
je cherche à faire un block qui en s'activant, activera tous les autres blocks du même type qui y sont connectés.
Le problème est le suivant :
Quand j'active le premier, il n'active pas les autres.
Si je change le code un peu afin que ça fonctionne, il active les autres mais quand on désactive le premier, tout les autres restent activés car il s'activent entre eux.

Voici une partie du code (la partie importante) :
Code:
public int tickRate()
    {
        return 0;
    }
 
    public boolean isBlockProvidingPoweringTo(IBlockAccess iblockaccess, int i, int j, int k, int l)
    {
        if(activedFence)
            return iblockaccess.getBlockId(i, j, k) == mod_RedstoneKit.RedstoneBlockIdle.blockID;
        else if(iblockaccess.getBlockId(i, j, k) == mod_RedstoneKit.RedstoneBlockActive.blockID)
            return true;
        else
            return false;
    }
 
    public boolean canProvidePower()
    {
        return true;
    }
 
    public void onNeighborBlockChange(World world, int i, int j, int k, int l)
    {
        if(l > 0 && Block.blocksList[l].canProvidePower())
        {
                world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
        }
    }
 
    public void updateTick(World world, int i, int j, int k, Random random)
    {
        if(world.isBlockGettingPowered(i, j, k) || world.isBlockIndirectlyGettingPowered(i, j, k))
        {
            //powered
            world.setBlockWithNotify(i, j, k, mod_RedstoneKit.RedstoneBlockActive.blockID);
        } else {
            //not powered
            world.setBlockWithNotify(i, j, k, mod_RedstoneKit.RedstoneBlockIdle.blockID);
        }
    }
 
    public boolean activedBlock;
Merci de votre réponse !