Escalier soumis à la gravité

Styvak

I am Evil !
30 Mars 2011
130
16
13
essaye d'ajouter :
Code:
public static boolean fallInstantly = false;
public void updateTick(World world, int i, int j, int k, Random random)
    {
        tryToFall(world, i, j, k);
    }
    private void tryToFall(World world, int i, int j, int k)
    {
        int l = i;
        int i1 = j;
        int j1 = k;
        if (canFallBelow(world, l, i1 - 1, j1) && i1 >= 0)
        {
            byte byte0 = 32;
            if (fallInstantly || !world.checkChunksExist(i - byte0, j - byte0, k - byte0, i + byte0, j + byte0, k + byte0))
            {
                world.setBlockWithNotify(i, j, k, 0);
                for (; canFallBelow(world, i, j - 1, k) && j > 0; j--) { }
                if (j > 0)
                {
                    world.setBlockWithNotify(i, j, k, blockID);
                }
            }
            else if (!world.multiplayerWorld)
            {
                EntityFallingSand entityfallingsand = new EntityFallingSand(world, (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, blockID);
                world.spawnEntityInWorld(entityfallingsand);
            }
        }
    }
    public int tickRate()
    {
        return 3;
    }
 

rafoudiablol

Lol ?!
29 Mai 2011
499
16
135
27
Il suffit de faire hériter la classe de BlockSand....
Cette classe contient déjà toutes les informations nécéssaires ;)

Par contre, je pense qu'il va y avoir un petit problème dans l'affichage du block en train de tomber....