public static boolean isCartLockedDown(EntityMinecart cart) {
        int x = MathHelper.floor_double(cart.posX);
        int y = MathHelper.floor_double(cart.posY);
        int z = MathHelper.floor_double(cart.posZ);

        if (BlockRailBase.func_150049_b_(cart.worldObj, x, y - 1, z))
            y--;

        TileEntity tile = cart.worldObj.getTileEntity(x, y, z);
        if (tile instanceof ITrackTile) {
            ITrackInstance track = ((ITrackTile) tile).getTrackInstance();
            return track instanceof ITrackLockdown && ((ITrackLockdown) track).isCartLockedDown(cart);
        } else if (tile instanceof ITrackLockdown)
            return ((ITrackLockdown) tile).isCartLockedDown(cart);
        return false;
    }