Esempio n. 1
0
    /// Place a block at the given coordinates, relative to the entire level itself.
    public void setBlock(float x, float y, float z, int type, int connid)
    {
        int rx = ((int)x) % blockSize;
        int ry = ((int)y) % blockSize;
        int rz = ((int)z);

        RegionBlock rb = getRegion(x, y);

        if (rb != null && rb.getBlock(rx, ry, rz) <= 0 && type != 10)
        {
            rb.setBlock(rx, ry, rz, type, connid);
        }
        else if (rb != null && rb.getBlock(rx, ry, rz) <= 0 && type == 10)
        {
            rb.setBlock(rx, ry, rz, type, connid);
        }

        refreshMesh();
    }